Initial refactoring merge 92/19092/1
authorDongchul Lim <dc7.lim@samsung.com>
Mon, 7 Apr 2014 10:49:09 +0000 (19:49 +0900)
committerDongchul Lim <dc7.lim@samsung.com>
Mon, 7 Apr 2014 10:49:29 +0000 (19:49 +0900)
Change-Id: Iee9435d42176e19611cd77f0182e64d3d30e4db2

78 files changed:
AUTHORS [deleted file]
CMakeLists.txt
LICENSE
include/dtapi_call.h [new file with mode: 0644]
include/dtapi_gps.h [new file with mode: 0644]
include/dtapi_main.h [new file with mode: 0644]
include/dtapi_manager.h [new file with mode: 0644]
include/dtapi_modem.h [new file with mode: 0644]
include/dtapi_network.h [new file with mode: 0644]
include/dtapi_phonebook.h [new file with mode: 0644]
include/dtapi_sap.h [new file with mode: 0644]
include/dtapi_sat.h [new file with mode: 0644]
include/dtapi_sim.h [new file with mode: 0644]
include/dtapi_sms.h [new file with mode: 0644]
include/dtapi_ss.h [new file with mode: 0644]
include/dtapi_util.h [new file with mode: 0644]
introspection/call.xml
introspection/convert_docbook_html.sh [deleted file]
introspection/convert_gtkdoc.sh [deleted file]
introspection/ex.xml [deleted file]
introspection/gen.sh [deleted file]
introspection/gps.xml
introspection/manager.xml
introspection/modem.xml
introspection/network.xml
introspection/phonebook.xml [changed mode: 0644->0755]
introspection/sap.xml
introspection/sat.xml
introspection/sim.xml
introspection/sms.xml
introspection/ss.xml
packaging/tel-plugin-dbus_tapi.spec
sat-manager/include/sat_manager.h [new file with mode: 0644]
sat-manager/include/sat_ui_support.h [new file with mode: 0644]
sat-manager/src/sat_manager.c [new file with mode: 0644]
sat-manager/src/sat_ui_support.c [new file with mode: 0644]
src/call.c [deleted file]
src/common.h [deleted file]
src/desc-dbus.c [deleted file]
src/desc.c [new file with mode: 0644]
src/dtapi_call.c [new file with mode: 0644]
src/dtapi_gps.c [new file with mode: 0644]
src/dtapi_main.c [new file with mode: 0644]
src/dtapi_manager.c [new file with mode: 0644]
src/dtapi_modem.c [new file with mode: 0644]
src/dtapi_network.c [new file with mode: 0644]
src/dtapi_phonebook.c [new file with mode: 0644]
src/dtapi_sap.c [new file with mode: 0644]
src/dtapi_sat.c [new file with mode: 0644]
src/dtapi_sim.c [new file with mode: 0644]
src/dtapi_sms.c [new file with mode: 0644]
src/dtapi_ss.c [new file with mode: 0644]
src/dtapi_util.c [new file with mode: 0644]
src/legacy/common.c [moved from src/common.c with 66% similarity]
src/legacy/common.h [new file with mode: 0644]
src/legacy/gps.c [moved from src/gps.c with 97% similarity]
src/legacy/modem.c [moved from src/modem.c with 98% similarity]
src/legacy/network.c [moved from src/network.c with 99% similarity]
src/legacy/phonebook.c [moved from src/phonebook.c with 99% similarity]
src/legacy/sap.c [moved from src/sap.c with 99% similarity]
src/legacy/sat.c [moved from src/sat.c with 99% similarity]
src/legacy/sat_manager.c [moved from src/sat_manager.c with 99% similarity]
src/legacy/sat_manager.h [moved from src/sat_manager.h with 98% similarity]
src/legacy/sat_ui_support/TelCall.h [moved from src/sat_ui_support/TelCall.h with 99% similarity]
src/legacy/sat_ui_support/TelDefines.h [moved from src/sat_ui_support/TelDefines.h with 92% similarity]
src/legacy/sat_ui_support/TelErr.h [moved from src/sat_ui_support/TelErr.h with 98% similarity]
src/legacy/sat_ui_support/TelSat.h [moved from src/sat_ui_support/TelSat.h with 99% similarity]
src/legacy/sat_ui_support/TelSatEnvelope.h [moved from src/sat_ui_support/TelSatEnvelope.h with 98% similarity]
src/legacy/sat_ui_support/TelSatObj.h [moved from src/sat_ui_support/TelSatObj.h with 99% similarity]
src/legacy/sat_ui_support/TelSatProactvCmd.h [moved from src/sat_ui_support/TelSatProactvCmd.h with 99% similarity]
src/legacy/sat_ui_support/TelSim.h [moved from src/sat_ui_support/TelSim.h with 99% similarity]
src/legacy/sat_ui_support/TelSs.h [moved from src/sat_ui_support/TelSs.h with 99% similarity]
src/legacy/sat_ui_support/sat_ui_support.c [moved from src/sat_ui_support/sat_ui_support.c with 97% similarity]
src/legacy/sat_ui_support/sat_ui_support.h [moved from src/sat_ui_support/sat_ui_support.h with 63% similarity]
src/legacy/sat_util.c [moved from src/sat_util.c with 99% similarity]
src/legacy/sim.c [moved from src/sim.c with 95% similarity]
src/legacy/sms.c [moved from src/sms.c with 99% similarity]
src/legacy/ss.c [moved from src/ss.c with 99% similarity]

diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644 (file)
index 0e9faa9..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,6 +0,0 @@
-Jongman Park <jman.park@samsung.com>
-Ja-young Gu <jygu@samsung.com>
-Kyeongchul Kim <kyeongchul.kim@samsung.com>
-DongHoo Park <donghoo.park@samsung.>
-Youngman Park <youngman.park@samsung.com>
-Inho Oh <inho48.oh@samsung.com>
index b818e87..0ebdc95 100644 (file)
@@ -17,51 +17,71 @@ FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/cmake_tmp ${CMAKE_SOURCE_DIR}/src/sat_ui_support/)
+INCLUDE_DIRECTORIES(
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/include/
+       ${CMAKE_SOURCE_DIR}/sat-manager/include/
+)
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -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=\"DBUS_TAPI\"")
 ADD_DEFINITIONS("-DPLUGIN_VERSION=${VERSION}")
+ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))")
 
 MESSAGE(${CMAKE_C_FLAGS})
 MESSAGE(${CMAKE_EXE_LINKER_FLAGS})
 
 SET(SRCS
-               src/desc-dbus.c
-               src/common.c
-               src/network.c
-               src/phonebook.c
-               src/sim.c
-               src/sap.c
-               src/sms.c
-               src/sat.c
-               src/sat_manager.c
-               src/sat_ui_support/sat_ui_support.c
-               src/ss.c
-               src/call.c
-               src/modem.c
-               src/gps.c
+       src/desc.c
+       src/dtapi_util.c
+       src/dtapi_main.c
+       src/dtapi_call.c
+       src/dtapi_gps.c
+       src/dtapi_manager.c
+       src/dtapi_modem.c
+       src/dtapi_network.c
+       src/dtapi_phonebook.c
+       src/dtapi_sap.c
+       src/dtapi_sat.c
+       src/dtapi_sim.c
+       src/dtapi_sms.c
+       src/dtapi_ss.c
+       sat-manager/src/sat_manager.c
+       sat-manager/src/sat_ui_support.c
+#      sat-manager/src/sat_util.c
 )
 
-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 ${CMAKE_SOURCE_DIR}/introspection/gps.xml
+SET(INTROSPECTION_PATH ${CMAKE_SOURCE_DIR}/introspection)
+
+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
+       ${INTROSPECTION_PATH}/manager.xml
+       ${INTROSPECTION_PATH}/network.xml
+       ${INTROSPECTION_PATH}/sim.xml
+       ${INTROSPECTION_PATH}/phonebook.xml
+       ${INTROSPECTION_PATH}/sap.xml
+       ${INTROSPECTION_PATH}/sat.xml
+       ${INTROSPECTION_PATH}/sms.xml
+       ${INTROSPECTION_PATH}/call.xml
+       ${INTROSPECTION_PATH}/ss.xml
+       ${INTROSPECTION_PATH}/modem.xml
+       ${INTROSPECTION_PATH}/gps.xml
        COMMENT "Generating GDBus .c/.h")
 
 # library build
-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 XXX)
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} ${CMAKE_BINARY_DIR}/generated-code.c)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "" OUTPUT_NAME ${PROJECT_NAME})
 
 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/res/tapi.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/res/tapi.conf)
 
 # install
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/tapi.conf DESTINATION ${PREFIX}/etc/dbus-1/system.d)
-INSTALL(TARGETS dbus-tapi-plugin
-               LIBRARY DESTINATION lib/telephony/plugins)
+INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib/telephony/plugins)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME tel-plugin-dbus_tapi)
diff --git a/LICENSE b/LICENSE
index bae7f54..3d69259 100644 (file)
--- a/LICENSE
+++ b/LICENSE
-Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
-\r
-                                 Apache License\r
-                           Version 2.0, January 2004\r
-                        http://www.apache.org/licenses/\r
-\r
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
-   1. Definitions.\r
-\r
-      "License" shall mean the terms and conditions for use, reproduction,\r
-      and distribution as defined by Sections 1 through 9 of this document.\r
-\r
-      "Licensor" shall mean the copyright owner or entity authorized by\r
-      the copyright owner that is granting the License.\r
-\r
-      "Legal Entity" shall mean the union of the acting entity and all\r
-      other entities that control, are controlled by, or are under common\r
-      control with that entity. For the purposes of this definition,\r
-      "control" means (i) the power, direct or indirect, to cause the\r
-      direction or management of such entity, whether by contract or\r
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
-      outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
-      "You" (or "Your") shall mean an individual or Legal Entity\r
-      exercising permissions granted by this License.\r
-\r
-      "Source" form shall mean the preferred form for making modifications,\r
-      including but not limited to software source code, documentation\r
-      source, and configuration files.\r
-\r
-      "Object" form shall mean any form resulting from mechanical\r
-      transformation or translation of a Source form, including but\r
-      not limited to compiled object code, generated documentation,\r
-      and conversions to other media types.\r
-\r
-      "Work" shall mean the work of authorship, whether in Source or\r
-      Object form, made available under the License, as indicated by a\r
-      copyright notice that is included in or attached to the work\r
-      (an example is provided in the Appendix below).\r
-\r
-      "Derivative Works" shall mean any work, whether in Source or Object\r
-      form, that is based on (or derived from) the Work and for which the\r
-      editorial revisions, annotations, elaborations, or other modifications\r
-      represent, as a whole, an original work of authorship. For the purposes\r
-      of this License, Derivative Works shall not include works that remain\r
-      separable from, or merely link (or bind by name) to the interfaces of,\r
-      the Work and Derivative Works thereof.\r
-\r
-      "Contribution" shall mean any work of authorship, including\r
-      the original version of the Work and any modifications or additions\r
-      to that Work or Derivative Works thereof, that is intentionally\r
-      submitted to Licensor for inclusion in the Work by the copyright owner\r
-      or by an individual or Legal Entity authorized to submit on behalf of\r
-      the copyright owner. For the purposes of this definition, "submitted"\r
-      means any form of electronic, verbal, or written communication sent\r
-      to the Licensor or its representatives, including but not limited to\r
-      communication on electronic mailing lists, source code control systems,\r
-      and issue tracking systems that are managed by, or on behalf of, the\r
-      Licensor for the purpose of discussing and improving the Work, but\r
-      excluding communication that is conspicuously marked or otherwise\r
-      designated in writing by the copyright owner as "Not a Contribution."\r
-\r
-      "Contributor" shall mean Licensor and any individual or Legal Entity\r
-      on behalf of whom a Contribution has been received by Licensor and\r
-      subsequently incorporated within the Work.\r
-\r
-   2. Grant of Copyright License. Subject to the terms and conditions of\r
-      this License, each Contributor hereby grants to You a perpetual,\r
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-      copyright license to reproduce, prepare Derivative Works of,\r
-      publicly display, publicly perform, sublicense, and distribute the\r
-      Work and such Derivative Works in Source or Object form.\r
-\r
-   3. Grant of Patent License. Subject to the terms and conditions of\r
-      this License, each Contributor hereby grants to You a perpetual,\r
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-      (except as stated in this section) patent license to make, have made,\r
-      use, offer to sell, sell, import, and otherwise transfer the Work,\r
-      where such license applies only to those patent claims licensable\r
-      by such Contributor that are necessarily infringed by their\r
-      Contribution(s) alone or by combination of their Contribution(s)\r
-      with the Work to which such Contribution(s) was submitted. If You\r
-      institute patent litigation against any entity (including a\r
-      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
-      or a Contribution incorporated within the Work constitutes direct\r
-      or contributory patent infringement, then any patent licenses\r
-      granted to You under this License for that Work shall terminate\r
-      as of the date such litigation is filed.\r
-\r
-   4. Redistribution. You may reproduce and distribute copies of the\r
-      Work or Derivative Works thereof in any medium, with or without\r
-      modifications, and in Source or Object form, provided that You\r
-      meet the following conditions:\r
-\r
-      (a) You must give any other recipients of the Work or\r
-          Derivative Works a copy of this License; and\r
-\r
-      (b) You must cause any modified files to carry prominent notices\r
-          stating that You changed the files; and\r
-\r
-      (c) You must retain, in the Source form of any Derivative Works\r
-          that You distribute, all copyright, patent, trademark, and\r
-          attribution notices from the Source form of the Work,\r
-          excluding those notices that do not pertain to any part of\r
-          the Derivative Works; and\r
-\r
-      (d) If the Work includes a "NOTICE" text file as part of its\r
-          distribution, then any Derivative Works that You distribute must\r
-          include a readable copy of the attribution notices contained\r
-          within such NOTICE file, excluding those notices that do not\r
-          pertain to any part of the Derivative Works, in at least one\r
-          of the following places: within a NOTICE text file distributed\r
-          as part of the Derivative Works; within the Source form or\r
-          documentation, if provided along with the Derivative Works; or,\r
-          within a display generated by the Derivative Works, if and\r
-          wherever such third-party notices normally appear. The contents\r
-          of the NOTICE file are for informational purposes only and\r
-          do not modify the License. You may add Your own attribution\r
-          notices within Derivative Works that You distribute, alongside\r
-          or as an addendum to the NOTICE text from the Work, provided\r
-          that such additional attribution notices cannot be construed\r
-          as modifying the License.\r
-\r
-      You may add Your own copyright statement to Your modifications and\r
-      may provide additional or different license terms and conditions\r
-      for use, reproduction, or distribution of Your modifications, or\r
-      for any such Derivative Works as a whole, provided Your use,\r
-      reproduction, and distribution of the Work otherwise complies with\r
-      the conditions stated in this License.\r
-\r
-   5. Submission of Contributions. Unless You explicitly state otherwise,\r
-      any Contribution intentionally submitted for inclusion in the Work\r
-      by You to the Licensor shall be under the terms and conditions of\r
-      this License, without any additional terms or conditions.\r
-      Notwithstanding the above, nothing herein shall supersede or modify\r
-      the terms of any separate license agreement you may have executed\r
-      with Licensor regarding such Contributions.\r
-\r
-   6. Trademarks. This License does not grant permission to use the trade\r
-      names, trademarks, service marks, or product names of the Licensor,\r
-      except as required for reasonable and customary use in describing the\r
-      origin of the Work and reproducing the content of the NOTICE file.\r
-\r
-   7. Disclaimer of Warranty. Unless required by applicable law or\r
-      agreed to in writing, Licensor provides the Work (and each\r
-      Contributor provides its Contributions) on an "AS IS" BASIS,\r
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
-      implied, including, without limitation, any warranties or conditions\r
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
-      PARTICULAR PURPOSE. You are solely responsible for determining the\r
-      appropriateness of using or redistributing the Work and assume any\r
-      risks associated with Your exercise of permissions under this License.\r
-\r
-   8. Limitation of Liability. In no event and under no legal theory,\r
-      whether in tort (including negligence), contract, or otherwise,\r
-      unless required by applicable law (such as deliberate and grossly\r
-      negligent acts) or agreed to in writing, shall any Contributor be\r
-      liable to You for damages, including any direct, indirect, special,\r
-      incidental, or consequential damages of any character arising as a\r
-      result of this License or out of the use or inability to use the\r
-      Work (including but not limited to damages for loss of goodwill,\r
-      work stoppage, computer failure or malfunction, or any and all\r
-      other commercial damages or losses), even if such Contributor\r
-      has been advised of the possibility of such damages.\r
-\r
-   9. Accepting Warranty or Additional Liability. While redistributing\r
-      the Work or Derivative Works thereof, You may choose to offer,\r
-      and charge a fee for, acceptance of support, warranty, indemnity,\r
-      or other liability obligations and/or rights consistent with this\r
-      License. However, in accepting such obligations, You may act only\r
-      on Your own behalf and on Your sole responsibility, not on behalf\r
-      of any other Contributor, and only if You agree to indemnify,\r
-      defend, and hold each Contributor harmless for any liability\r
-      incurred by, or claims asserted against, such Contributor by reason\r
-      of your accepting any such warranty or additional liability.\r
-\r
-   END OF TERMS AND CONDITIONS\r
-\r
-   APPENDIX: How to apply the Apache License to your work.\r
-\r
-      To apply the Apache License to your work, attach the following\r
-      boilerplate notice, with the fields enclosed by brackets "[]"\r
-      replaced with your own identifying information. (Don't include\r
-      the brackets!)  The text should be enclosed in the appropriate\r
-      comment syntax for the file format. We also recommend that a\r
-      file or class name and description of purpose be included on the\r
-      same "printed page" as the copyright notice for easier\r
-      identification within third-party archives.\r
-\r
-   Copyright [yyyy] [name of copyright owner]\r
-\r
-   Licensed under the Apache License, Version 2.0 (the "License");\r
-   you may not use this file except in compliance with the License.\r
-   You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-   Unless required by applicable law or agreed to in writing, software\r
-   distributed under the License is distributed on an "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-   See the License for the specific language governing permissions and\r
-   limitations under the License.\r
-\r
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
diff --git a/include/dtapi_call.h b/include/dtapi_call.h
new file mode 100644 (file)
index 0000000..c856de9
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_call_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_call_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_gps.h b/include/dtapi_gps.h
new file mode 100644 (file)
index 0000000..3701cad
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_gps_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_gps_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_main.h b/include/dtapi_main.h
new file mode 100644 (file)
index 0000000..78b9390
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_plugin_init(TcorePlugin *plugin);
+void dtapi_plugin_deinit(TcorePlugin *plugin);
diff --git a/include/dtapi_manager.h b/include/dtapi_manager.h
new file mode 100644 (file)
index 0000000..5b56845
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+TelephonyManager *dtapi_manager_new(Server *server);
\ No newline at end of file
diff --git a/include/dtapi_modem.h b/include/dtapi_modem.h
new file mode 100644 (file)
index 0000000..c1ab662
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_modem_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_modem_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_network.h b/include/dtapi_network.h
new file mode 100644 (file)
index 0000000..b5006ee
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_network_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_network_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_phonebook.h b/include/dtapi_phonebook.h
new file mode 100644 (file)
index 0000000..cffdc8e
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_phonebook_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_phonebook_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_sap.h b/include/dtapi_sap.h
new file mode 100644 (file)
index 0000000..5f646cb
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_sap_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_sap_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_sat.h b/include/dtapi_sat.h
new file mode 100644 (file)
index 0000000..49a9032
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_sat_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin, TcorePlugin *comm_plugin);
+gboolean dtapi_handle_sat_notification(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin, TcorePlugin *comm_plugin, TcoreNotification command,
+       guint data_len, const void *data);
diff --git a/include/dtapi_sim.h b/include/dtapi_sim.h
new file mode 100644 (file)
index 0000000..d8f5963
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_sim_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_sim_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_sms.h b/include/dtapi_sms.h
new file mode 100644 (file)
index 0000000..47aef8c
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_sms_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_sms_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_ss.h b/include/dtapi_ss.h
new file mode 100644 (file)
index 0000000..bf58eb0
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+
+gboolean dtapi_setup_ss_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin);
+gboolean dtapi_handle_ss_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data);
diff --git a/include/dtapi_util.h b/include/dtapi_util.h
new file mode 100644 (file)
index 0000000..788a9c5
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <glib.h>
+#include <tcore.h>
+#include <gio/gio.h>
+
+#define dtapi_return_error(ivc,error,message) \
+       do { \
+               err("%s", message); \
+               g_dbus_method_invocation_return_error(ivc, \
+               G_DBUS_ERROR, error, message); \
+       } while (0)
+
+typedef struct {
+       void *interface_object;
+       GDBusMethodInvocation *invocation;
+       char user_data[0]; /* Additional user data base pointer */
+} DbusRespCbData;
+
+GVariant *dtapi_create_empty_variant(const gchar *format_string); /* We should free the variant after use */
+inline DbusRespCbData *dtapi_create_resp_cb_data(void *interface_object,
+       GDBusMethodInvocation *invocation, void *user_data, unsigned int ud_len);
+inline const char *dtapi_get_cp_name_by_object_path(const char *object_path);
+gboolean dtapi_check_access_control(GDBusMethodInvocation *invoc,
+       const char *label, const char *perm);
index 1eff192..5c2cbef 100644 (file)
-<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>
-
-               <method name="SetSoundClockStatus">
-                       <arg direction="in" type="b" name="clock_status"/>
-                       <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>
-
-               <signal name="CallSoundClockStatus">
-                       <arg type="b" name="status"/>
-               </signal>
-
-       </interface>
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 
+<node>
+  <interface name="org.tizen.telephony.Call">
+
+    <!-- Refer to TAPI API: tapi_call_dial -->
+    <method name="Dial">
+      <arg direction="in" type="i" name="call_type"/>
+      <arg direction="in" type="i" name="ecc"/>
+      <arg direction="in" type="s" name="number"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_answer -->
+    <method name="Answer">
+      <arg direction="in" type="i" name="answer_type"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_end-->
+    <method name="End">
+      <arg direction="in" type="u" name="call_id"/>
+      <arg direction="in" type="i" name="end_type"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_send_dtmf -->
+    <method name="SendDtmf">
+      <arg direction="in" type="s" name="dtmf_str"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_hold -->
+    <method name="Hold">
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_active -->
+    <method name="Active">
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_swap -->
+    <method name="Swap">
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_join -->
+    <method name="Join">
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_split -->
+    <method name="Split">
+      <arg direction="in" type="u" name="call_id"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_transfer -->
+    <method name="Transfer">
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_deflect -->
+    <method name="Deflect">
+      <arg direction="in" type="s" name="deflect_to"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+     <!-- Refer to TAPI API: tapi_call_set_active_line -->
+    <method name="SetActiveLine">
+      <arg direction="in" type="i" name="active_line"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_get_active_line -->
+    <method name="GetActiveLine">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="i" name="active_line"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_get_status -->
+    <method name="GetStatus">
+      <arg direction="in" type="u" name="call_id"/>
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="call_id"/>
+      <arg direction="out" type="i" name="call_type"/>
+      <arg direction="out" type="i" name="call_state"/>
+      <arg direction="out" type="b" name="mo_call"/>
+      <arg direction="out" type="b" name="mpty"/>
+      <arg direction="out" type="i" name="cli_validity"/>
+      <arg direction="out" type="s" name="number"/>
+      <arg direction="out" type="i" name="cni_validity"/>
+      <arg direction="out" type="s" name="name"/>
+      <arg direction="out" type="b" name="forward"/>
+      <arg direction="out" type="i" name="active_line"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_get_status_all -->
+    <method name="GetStatusAll">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="count"/>
+      <arg direction="out" type="aa{sv}" name="status_list"/>
+    </method>
+
+    <!-- Refer to TAPI API: -->
+    <method name="SetVolumeInfo">
+      <arg direction="in" type="i" name="device"/>
+      <arg direction="in" type="u" name="volume"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_get_volume_info -->
+    <method name="GetVolumeInfo">
+      <arg direction="in" type="i" name="sound_device"/>
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="volume_info"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_set_sound_path -->
+    <method name="SetSoundPath">
+      <arg direction="in" type="i" name="path"/>
+      <arg direction="in" type="b" name="ex_volume"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_set_mute_status -->
+    <method name="SetMute">
+       <arg direction="in" type="b" name="mute"/>
+       <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_get_mute_status -->
+    <method name="GetMuteStatus">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="b" name="mute"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_set_sound_recording -->
+    <method name="SetSoundRecording">
+      <arg direction="in" type="i" name="sound_rec"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_call_set_sound_equalization -->
+    <method name="SetSoundEqualization">
+      <arg direction="in" type="i" name="mode"/>
+      <arg direction="in" type="i" name="direction"/>
+      <arg direction="in" type="aq" name="parameter"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TEL_NOTI_VOICE_CALL_STATUS_IDLE -->
+    <signal name="VoiceCallStatusIdle">
+      <arg type="u" name="call_id"/>
+      <arg type="i" name="cause"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VOICE_CALL_STATUS_ACTIVE -->
+    <signal name="VoiceCallStatusActive">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VOICE_CALL_STATUS_HELD -->
+    <signal name="VoiceCallStatusHeld">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VOICE_CALL_STATUS_DIALING -->
+    <signal name="VoiceCallStatusDialing">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VOICE_CALL_STATUS_ALERT -->
+    <signal name="VoiceCallStatusAlert">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VOICE_CALL_STATUS_INCOMING -->
+    <signal name="VoiceCallStatusIncoming">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VIDEO_CALL_STATUS_IDLE -->
+    <signal name="VideoCallStatusIdle">
+      <arg type="u" name="call_id"/>
+      <arg type="i" name="end_cause"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VIDEO_CALL_STATUS_ACTIVE -->
+    <signal name="VideoCallStatusActive">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VIDEO_CALL_STATUS_DIALING -->
+    <signal name="VideoCallStatusDialing">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VIDEO_CALL_STATUS_ALERT -->
+    <signal name="VideoCallStatusAlert">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_VIDEO_CALL_STATUS_INCOMING -->
+    <signal name="VideoCallStatusIncoming">
+      <arg type="u" name="call_id"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MO_WAITING -->
+    <signal name="MoWaiting">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MO_FORWARDED -->
+    <signal name="MoForwarded">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MO_BARRED_INCOMING -->
+    <signal name="MoBarredIncoming">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MO_BARRED_OUTGOING -->
+    <signal name="MoBarredOutgoing">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MO_FORWARD_UNCONDITIONAL -->
+    <signal name="MoForwardUnconditional">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MO_FORWARD_CONDITIONAL -->
+    <signal name="MoForwardConditional">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MO_DEFLECTED -->
+    <signal name="MoDeflected">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_TRANSFERED -->
+    <signal name="Transfered">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MT_FORWARDED -->
+    <signal name="MtForwarded">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_MT_DEFLECTED -->
+    <signal name="MtDeflected">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_HELD -->
+    <signal name="CallHeld">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_ACTIVE -->
+    <signal name="CallActive">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_INFO_JOINED -->
+    <signal name="CallJoined">
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_SOUND_RINGBACK_TONE -->
+    <signal name="CallSoundRingbackTone">
+      <arg type="i" name="status"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_SOUND_WBAMR -->
+    <signal name="CallSoundWbamr">
+      <arg type="i" name="status"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_SOUND_EQUALIZATION -->
+    <signal name="CallSoundEqualization">
+      <arg type="i" name="mode"/>
+      <arg type="i" name="direction"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_CALL_SOUND_CLOCK_STATUS -->
+    <signal name="CallSoundClockStatus">
+       <arg type="b" name="status"/>
+    </signal>
+
+    </interface>
 </node>
diff --git a/introspection/convert_docbook_html.sh b/introspection/convert_docbook_html.sh
deleted file mode 100755 (executable)
index 2ac0c00..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/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
deleted file mode 100755 (executable)
index 91e2dc6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-mkdir output 2>/dev/null
-
-OUTPUT=`basename $1`
-
-gtkdoc-mkhtml TEST $1
diff --git a/introspection/ex.xml b/introspection/ex.xml
deleted file mode 100644 (file)
index 9aa52e5..0000000
+++ /dev/null
@@ -1,538 +0,0 @@
-<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)
-                       @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="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>"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
deleted file mode 100755 (executable)
index bc1f5a9..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-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 gps.xml
index edac7f6..54523e5 100644 (file)
@@ -1,31 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+
 <node>
-       <!--
-               org.tizen.telephony.Gps:
-               @short_description: Tizen Telephony Gps interface
-
-               Gps interface.
-
-       -->
-       <interface name="org.tizen.telephony.Gps">
-               <method name="SetFrequencyAiding">
-                       <arg direction="in" type="y" name="state"/>
-                       <arg direction="out" type="i" name="result"/>
-               </method>
-               <method name="ConfirmMeasurePos">
-                       <arg direction="in" type="s" name="data"/>
-                       <arg direction="out" type="i" name="result"/>
-               </method>
-               <signal name="AssistData">
-                       <arg type="s" name="data"/>
-               </signal>
-               <signal name="MeasurePosition">
-                       <arg type="s" name="data"/>
-               </signal>
-               <signal name="ResetAssistData">
-               </signal>
-               <signal name="FrequencyAiding">
-                       <arg type="s" name="data"/>
-               </signal>
-       </interface>
+  <interface name="org.tizen.telephony.Gps">
+
+    <!-- Refer to TAPI API: tapi_gps_confirm_measure_pos() -->
+    <method name="ConfirmMeasurePos">
+      <arg direction="in" type="s" name="data"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_gps_set_frequency_aiding() -->
+    <method name="SetFrequencyAiding">
+      <arg direction="in" type="b" name="state"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TEL_NOTI_GPS_ASSIST_DATA event -->
+    <signal name="AssistData">
+      <arg type="s" name="data"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_GPS_MEASURE_POSITION event -->
+    <signal name="MeasurePosition">
+      <arg type="s" name="data"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_GPS_RESET_ASSIST_DATA event -->
+    <signal name="ResetAssistData">
+    </signal>
 
+  </interface>
 </node>
index a14c937..867b994 100644 (file)
@@ -1,9 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+
 <node>
 
-       <interface name="org.tizen.telephony.Manager">
-               <method name="GetModems">
-                       <arg direction="out" type="as" name="list"/>
-               </method>
-       </interface>
+    <!-- Refer to TAPI API: tel_get_cp_name_list() -->
+    <interface name="org.tizen.telephony.Manager">
+        <method name="GetModems">
+            <arg direction="out" type="as" name="modem_list"/>
+        </method>
+    </interface>
 
 </node>
index cdbceea..16acfe9 100644 (file)
-<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)
-
-                       Request to ...
-               -->
-               <method name="SetFlightMode">
-                       <arg direction="in" type="b" name="enable"/>
-                       <arg direction="out" type="i" name="result"/>
-               </method>
-
-               <!--
-                       GetFlightMode:
-                       @result: Success(0)
-                       @enable: Flight mode Off (FLASE), Flight mode On (TRUE)
-
-                       Request to ...
-               -->
-               <method name="GetFlightMode">
-                       <arg direction="out" 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>
+<?xml version="1.0" encoding="UTF-8" ?>
 
-               <!--
-                       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>
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 
+<node>
+  <interface name="org.tizen.telephony.Modem">
+
+    <!-- Refer to TAPI API: tapi_modem_set_power_status() -->
+    <method name="SetPowerStatus">
+      <arg direction="in" type="i" name="status"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_modem_set_flight_mode() -->
+    <method name="SetFlightMode">
+      <arg direction="in" type="b" name="enable"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_modem_get_flight_mode() -->
+    <method name="GetFlightMode">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="b" name="enable"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_modem_get_version() -->
+      <method name="GetVersion">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="s" name="software_version"/>
+      <arg direction="out" type="s" name="hardware_version"/>
+      <arg direction="out" type="s" name="calibration_date"/>
+      <arg direction="out" type="s" name="product_code"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_modem_get_imei() -->
+    <method name="GetImei">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="s" name="imei"/>
+    </method>
+
+    <!-- Caches power status -->
+    <property name="status" type="i" access="read"/>
+
+    <!-- Caches flight mode status -->
+    <property name="flight_mode_status" type="i" access="read"/>
+
+    <!-- Caches IMEI value -->
+    <property name="imei" type="s" access="read"/>
+
+    <!--
+         Version information
+         @version: software_version, hardware_version, calibration_date, product_code
+    -->
+    <property name="version" type="a{sv}" access="read"/>
+
+  </interface>
 </node>
index da2721b..edadd29 100644 (file)
-<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)
-                       @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="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>"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>
+<?xml version="1.0" encoding="UTF-8" ?>
 
-               <!--
-                       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)
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 
-                       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>
-
-               <method name="GetNgbrCellInfo">
-                       <arg direction="out" type="aa{sv}" name="info"/>
-                       <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"/>
+<node>
 
-       </interface>
+  <interface name="org.tizen.telephony.Network">
+
+    <!-- Refer to TAPI API: tapi_network_get_identity_info()-->
+    <method name="GetIdentityInfo">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="s" name="plmn"/>
+      <arg direction="out" type="s" name="short_name"/>
+      <arg direction="out" type="s" name="long_name"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_search()-->
+    <method name="Search">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="count"/>
+      <arg direction="out" type="aa{sv}" name="network_list"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_cancel_search()-->
+    <method name="CancelSearch">
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_select_automatic() -->
+    <method name="SelectAutomatic">
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API:tapi_network_select_manual() -->
+    <method name="SelectManual">
+      <arg direction="in" type="s" name="plmn"/>
+      <arg direction="in" type="i" name="act"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_get_selection_mode() -->
+    <method name="GetSelectionMode">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="i" name="selection_mode"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_set_preferred_plmn() -->
+    <method name="SetPreferredPlmn">
+      <arg direction="in" type="u" name="index"/>
+      <arg direction="in" type="s" name="plmn"/>
+      <arg direction="in" type="i" name="act"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_get_preferred_plmn()-->
+    <method name="GetPreferredPlmn">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="count"/>
+      <arg direction="out" type="aa{sv}" name="list"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_set_mode()-->
+    <method name="SetMode">
+      <arg direction="in" type="i" name="mode"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_get_mode()-->
+    <method name="GetMode">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="i" name="mode"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_network_get_neighboring_cell_info()-->
+    <method name="GetNgbrCellInfo">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="gsm_list_count"/>
+      <arg direction="out" type="aa{sv}" name="gsm_list"/>
+      <arg direction="out" type="u" name="umts_list_count"/>
+      <arg direction="out" type="aa{sv}" name="umts_list"/>
+    </method>
+
+    <!-- Refer to TEL_NOTI_NETWORK_REGISTRATION_STATUS -->
+    <signal name="RegistrationStatus">
+      <arg type="i" name="cs_status"/>
+      <arg type="i" name="ps_status"/>
+      <arg type="i" name="act"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_NETWORK_CELL_INFO -->
+    <signal name="CellInfo">
+      <arg type="u" name="lac"/>
+      <arg type="u" name="cell_id"/>
+      <arg type="u" name="rac"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_NETWORK_IDENTITY -->
+    <signal name="Identity">
+      <arg type="s" name="plmn"/>
+      <arg type="s" name="short_name"/>
+      <arg type="s" name="long_name"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_NETWORK_RSSI -->
+    <signal name="Rssi">
+      <arg type="u" name="rssi"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_NETWORK_TIME_INFO -->
+    <signal name="TimeInfo">
+      <arg type="u" name="year"/>
+      <arg type="u" name="month"/>
+      <arg type="u" name="day"/>
+      <arg type="u" name="hour"/>
+      <arg type="u" name="minute"/>
+      <arg type="u" name="second"/>
+      <arg type="i" name="gmtoff"/>
+      <arg type="b" name="isdst"/>
+      <arg type="i" name="dstoff"/>
+      <arg type="s" name="plmn"/>
+    </signal>
+
+     <!-- Caches rssi -->
+    <property name="rssi" type="u" access="read"/>
+
+    <!-- Caches lac  -->
+    <property name="lac" type="u" access="read"/>
+
+    <!-- Caches cell_id  -->
+    <property name="cell_id" type="u" access="read"/>
+
+    <!-- Caches rac  -->
+    <property name="rac" type="u" access="read"/>
+
+    <!-- Caches act -->
+    <property name="act" type="i" access="read"/>
+
+    <!-- Caches circuit_status  -->
+    <property name="cs_status" type="i" access="read"/>
+
+    <!-- Caches packet_status  -->
+    <property name="ps_status" type="i" access="read"/>
+
+  </interface>
 
 </node>
old mode 100644 (file)
new mode 100755 (executable)
index 0f87bd8..c3da7f1
@@ -1,98 +1,65 @@
-<node>
+<?xml version="1.0" encoding="UTF-8" ?>
 
-       <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>
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 
-               <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>
+<node>
 
-               <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>
+    <interface name="org.tizen.telephony.Phonebook">
+        <!-- Refer to TAPI API: tapi_pb_get_sim_pb_init_info () -->
+        <method name="GetInitInfo">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="b" name="init_completed"/>
+            <arg direction="out" type="b" name="fdn"/>
+            <arg direction="out" type="b" name="adn"/>
+            <arg direction="out" type="b" name="sdn"/>
+            <arg direction="out" type="b" name="usim"/>
+        </method>
 
-               <method name="GetUsimMetaInfo">
-                       <arg direction="out" type="i" name="result"/>
-                       <arg direction="out" type="aa{sv}" name="list"/>
-               </method>
+        <!-- Refer to TAPI API: tapi_pb_get_sim_pb_info() -->
+        <method name="GetInfo">
+            <arg direction="in" type="i" name="pb_type"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="pb_type"/>
+            <arg direction="out" type="a{sv}" name="info_u"/>
+        </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="sne"/>
-                       <arg direction="out" type="i" name="sne_dcs"/>
-                       <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>
+        <!-- Refer to TAPI API: tapi_pb_read_sim_pb_record() -->
+        <method name="ReadRecord">
+            <arg direction="in" type="i" name="pb_type"/>
+            <arg direction="in" type="u" name="index"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="u" name="index"/>
+            <arg direction="out" type="u" name="next_index"/>
+            <arg direction="out" type="i" name="pb_type"/>
+            <arg direction="out" type="a{sv}" name="rec_u"/>
+        </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="sne"/>
-                       <arg direction="in" type="i" name="sne_dcs"/>
-                       <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>
+        <!-- Refer to TAPI API: tapi_pb_update_sim_pb_record() -->
+        <method name="UpdateRecord">
+            <arg direction="in" type="i" name="pb_type"/>
+            <arg direction="in" type="u" name="index"/>
+            <arg direction="in" type="a{sv}" name="rec_u"/>
+            <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>
+        <!-- Refer to TAPI API: tapi_pb_delete_sim_pb_record() -->
+        <method name="DeleteRecord">
+            <arg direction="in" type="i" name="pb_type"/>
+            <arg direction="in" type="u" name="index"/>
+            <arg direction="out" type="i" name="result"/>
+        </method>
 
-               <signal name="Status">
-                       <arg type="i" name="status"/>
-               </signal>
+        <!-- Refer to TEL_NOTI_PB_STATUS event -->
+        <signal name="Status">
+            <arg type="b" name="init_status"/>
+            <arg type="b" name="fdn"/>
+            <arg type="b" name="adn"/>
+            <arg type="b" name="sdn"/>
+            <arg type="b" name="usim"/>
+        </signal>
 
-       </interface>
+    </interface>
 
 </node>
index 1125695..36f0b01 100644 (file)
@@ -1,55 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+
 <node>
 
        <interface name="org.tizen.telephony.Sap">
 
-               <method name="Connect">
-                       <arg direction="in" type="i" name="req_max_size"/>
+               <!-- Refer to TAPI API: tapi_sap_req_connect() -->
+               <method name="ReqConnect">
+                       <arg direction="in" type="u" name="max_msg_size"/>
                        <arg direction="out" type="i" name="result"/>
-                       <arg direction="out" type="i" name="resp_max_size"/>
+                       <arg direction="out" type="u" name="max_msg_size_resp"/>
                </method>
 
-               <method name="Disconnect">
+               <!-- Refer to TAPI API: tapi_sap_req_disconnect() -->
+               <method name="ReqDisconnect">
                        <arg direction="out" type="i" name="result"/>
                </method>
 
-               <method name="GetStatus">
-                       <arg direction="out" type="i" name="status"/>
-               </method>
-
-               <method name="GetATR">
+               <!-- Refer to TAPI API: tapi_sap_get_atr() -->
+               <method name="GetAtr">
                        <arg direction="out" type="i" name="result"/>
-                       <arg direction="out" type="v" name="atr"/>
+                       <arg direction="out" type="s" name="atr"/>
                </method>
 
-               <method name="TransferAPDU">
-                       <arg direction="in" type="v" name="req_apdu"/>
+               <!-- Refer to TAPI API: tapi_sap_req_transfer_apdu() -->
+               <method name="ReqTransferApdu">
+                       <arg direction="in" type="s" name="apdu"/>
                        <arg direction="out" type="i" name="result"/>
-                       <arg direction="out" type="v" name="resp_apdu"/>
+                       <arg direction="out" type="s" name="apdu_resp"/>
                </method>
 
-               <method name="SetProtocol">
+               <!-- Refer to TAPI API: tapi_sap_req_transport_protocol() -->
+               <method name="ReqTransportProtocol">
                        <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"/>
+               <!-- Refer to TAPI API: tapi_sap_req_power_operation() -->
+               <method name="ReqPowerOperation">
+                       <arg direction="in" type="i" name="power_mode"/>
                        <arg direction="out" type="i" name="result"/>
                </method>
 
+               <!-- Refer to TAPI API: tapi_sap_get_cardreader_status() -->
                <method name="GetCardReaderStatus">
                        <arg direction="out" type="i" name="result"/>
                        <arg direction="out" type="i" name="status"/>
                </method>
 
-               <signal name="status">
+               <signal name="Status">
                        <arg type="i" name="status"/>
                </signal>
 
-               <signal name="disconnect">
-                       <arg type="i" name="type"/>
-               </signal>
-
        </interface>
 
 </node>
index 3c42b18..0515c1e 100644 (file)
@@ -1,13 +1,13 @@
 <node>
        <!--
-               org.tizen.telephony.SAT:
+               org.tizen.telephony.Sat:
                @short_description: Tizen Telephony SIM Application Toolkit interface
 
                SAT interface.
 
        -->
-       <interface name="org.tizen.telephony.SAT">
-       
+       <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_help_info"/>
                        <arg direction="out" type="b" name="menu_updated"/>
                </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>
+
                <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"/>
@@ -65,7 +65,7 @@
                        <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"/>
@@ -75,7 +75,7 @@
                        <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"/>
@@ -85,7 +85,7 @@
                        <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"/>
@@ -96,7 +96,7 @@
                        <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="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="tone_type"/>
                        <arg type="i" name="duration"/>
                </signal>
-                               
+
                <signal name="SendSMS">
                        <arg type="i" name="command_id"/>
                        <arg type="s" name="text"/>
                        <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="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"/>
                        <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="i" name="channel_id"/>
                </signal>
-                               
+
                <signal name="ReceiveData">
                        <arg type="i" name="command_id"/>
                        <arg type="s" name="text"/>
                        <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="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="launch_type"/>
                        <arg type="s" name="text"/>
                        <arg type="i" name="text_len"/>
                </signal>
-               
+
                <signal name="ProvideLocalInfo">
                        <arg type="i" name="info_type"/>
                </signal>
-               
+
                <signal name="LanguageNotification">
                        <arg type="i" name="command_id"/>
                        <arg type="i" name="language"/>
                <signal name="EndProactiveSession">
                        <arg type="i" name="command_type"/>
                </signal>
-               
+
        </interface>
-       
+
 </node>
index 9aeae60..6cfa0eb 100644 (file)
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+
 <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="cphs"/>
-                       <arg direction="out" type="aa{sv}" name="cf"/>
-                       <arg direction="out" type="a{sv}" name="cphs_cf"/>
-               </method>
-
-               <method name="SetCallForwarding">
-                       <arg direction="in" type="b" name="cphs"/>
-                       <arg direction="in" type="i" name="rec_index"/>
-                       <arg direction="in" type="i" name="msp_num"/>
-                       <arg direction="in" type="y" name="cfu_status"/>
-                       <arg direction="in" type="i" name="ton"/>
-                       <arg direction="in" type="i" name="npi"/>
-                       <arg direction="in" type="s" name="number"/>
-                       <arg direction="in" type="i" name="cc2_id"/>
-                       <arg direction="in" type="i" name="ext7_id"/>
-                       <arg direction="in" type="b" name="cphs_line1"/>
-                       <arg direction="in" type="b" name="cphs_line2"/>
-                       <arg direction="in" type="b" name="cphs_fax"/>
-                       <arg direction="in" type="b" name="cphs_data"/>
-                       <arg direction="out" type="i" name="result"/>
-               </method>
-
-               <method name="GetMessageWaiting">
-                       <arg direction="out" type="i" name="result"/>
-                       <arg direction="out" type="b" name="cphs"/>
-                       <arg direction="out" type="aa{sv}" name="mw"/>
-                       <arg direction="out" type="a{sv}" name="cphs_mw"/>
-               </method>
-
-               <method name="SetMessageWaiting">
-                       <arg direction="in" type="b" name="cphs"/>
-                       <arg direction="in" type="i" name="rec_index"/>
-                       <arg direction="in" type="y" name="indicator_status"/>
-                       <arg direction="in" type="i" name="voice_cnt"/>
-                       <arg direction="in" type="i" name="fax_cnt"/>
-                       <arg direction="in" type="i" name="email_cnt"/>
-                       <arg direction="in" type="i" name="other_cnt"/>
-                       <arg direction="in" type="i" name="video_cnt"/>
-                       <arg direction="in" type="b" name="cphs_voice1"/>
-                       <arg direction="in" type="b" name="cphs_voice2"/>
-                       <arg direction="in" type="b" name="cphs_fax"/>
-                       <arg direction="in" type="b" name="cphs_data"/>
-                       <arg direction="out" type="i" name="result"/>
-               </method>
-
-               <method name="GetMailbox">
-                       <arg direction="out" type="i" name="result"/>
-                       <arg direction="out" type="b" name="cphs"/>
-                       <arg direction="out" type="aa{sv}" name="list"/>
-               </method>
-
-               <method name="SetMailbox">
-                       <arg direction="in" type="b" name="cphs"/>
-                       <arg direction="in" type="i" name="type"/>
-                       <arg direction="in" type="i" name="rec_index"/>
-                       <arg direction="in" type="i" name="profile_number"/>
-                       <arg direction="in" type="i" name="alpha_id_max_len"/>
-                       <arg direction="in" type="s" name="alpha_id"/>
-                       <arg direction="in" type="i" name="ton"/>
-                       <arg direction="in" type="i" name="npi"/>
-                       <arg direction="in" type="s" name="number"/>
-                       <arg direction="in" type="i" name="cc_id"/>
-                       <arg direction="in" type="i" name="ext1_id"/>
-                       <arg direction="out" type="i" name="result"/>
-               </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>
+    <interface name="org.tizen.telephony.Sim">
+        <!-- Refer to TAPI API: tapi_sim_get_imsi () -->
+        <method name="GetImsi">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="s" name="mcc"/>
+            <arg direction="out" type="s" name="mnc"/>
+            <arg direction="out" type="s" name="msin"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_ecc () -->
+        <method name="GetEcc">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="u" name="count"/>
+            <arg direction="out" type="aa{sv}" name="ecc_list"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_iccid () -->
+        <method name="GetIccid">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="s" name="iccid"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_language () -->
+        <method name="GetLanguage">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="language"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_set_language () -->
+        <method name="SetLanguage">
+            <arg direction="in" type="i" name="language"/>
+            <arg direction="out" type="i" name="result"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_callforwarding_info () -->
+        <method name="GetCallForwardingInfo">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="u" name="profile_count"/>
+            <arg direction="out" type="aa{sv}" name="cf"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_messagewaiting_info () -->
+        <method name="GetMessageWaitingInfo">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="u" name="profile_count"/>
+            <arg direction="out" type="aa{sv}" name="mw"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_set_messagewaiting_info () -->
+        <method name="SetMessageWaitingInfo">
+            <arg direction="in" type="y" name="profile_id"/>
+            <arg direction="in" type="b" name="count_valid"/>
+            <arg direction="in" type="a(by)" name="msg_waiting"/>
+            <arg direction="out" type="i" name="result"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_mailbox_info () -->
+        <method name="GetMailboxInfo">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="u" name="alpha_id_max_len"/>
+            <arg direction="out" type="u" name="count"/>
+            <arg direction="out" type="aa{sv}" name="list"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_set_mailbox_info () -->
+        <method name="SetMailboxInfo">
+            <arg direction="in" type="y" name="profile_id"/>
+            <arg direction="in" type="i" name="mb_type"/>
+            <arg direction="in" type="u" name="alpha_id_len"/>
+            <arg direction="in" type="s" name="alpha_id"/>
+            <arg direction="in" type="s" name="number"/>
+            <arg direction="out" type="i" name="result"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_msisdn () -->
+        <method name="GetMsisdn">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="u" name="count"/>
+            <arg direction="out" type="aa{sv}" name="list"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_spn () -->
+        <method name="GetSpn">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="display_condition"/>
+            <arg direction="out" type="s" name="spn"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_cphs_netname () -->
+        <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>
+
+        <!-- Refer to TAPI API: tapi_sim_get_sp_display_info() -->
+        <method name="GetSpDisplayInfo">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="u" name="count"/>
+            <arg direction="out" type="aa{sv}" name="list"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_req_authentication () -->
+        <method name="ReqAuthentication">
+            <arg direction="in" type="i" name="auth_type"/>
+            <arg direction="in" type="s" name="rand_data"/>
+            <arg direction="in" type="s" name="autn_data"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="auth_type"/>
+            <arg direction="out" type="s" name="resp_data"/>
+            <arg direction="out" type="s" name="authentication_key"/>
+            <arg direction="out" type="s" name="cipher_data"/>
+            <arg direction="out" type="s" name="integrity_data"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_verify_pins () -->
+        <method name="VerifyPins">
+            <arg direction="in" type="i" name="pin_type"/>
+            <arg direction="in" type="s" name="pw"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="pin_type"/>
+            <arg direction="out" type="u" name="retry_count"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_verify_puks () -->
+        <method name="VerifyPuks">
+            <arg direction="in" type="i" name="puk_type"/>
+            <arg direction="in" type="s" name="puk_pw"/>
+            <arg direction="in" type="s" name="new_pin_pw"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="puk_type"/>
+            <arg direction="out" type="u" name="retry_count"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_change_pins () -->
+        <method name="ChangePins">
+            <arg direction="in" type="i" name="pin_type"/>
+            <arg direction="in" type="s" name="old_pw"/>
+            <arg direction="in" type="s" name="new_pw"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="pin_type"/>
+            <arg direction="out" type="u" name="retry_count"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_disable_facility () -->
+        <method name="DisableFacility">
+            <arg direction="in" type="i" name="lock_type"/>
+            <arg direction="in" type="s" name="pw"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="type"/>
+            <arg direction="out" type="u" name="retry_count"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_enable_facility () -->
+        <method name="EnableFacility">
+            <arg direction="in" type="i" name="lock_type"/>
+            <arg direction="in" type="s" name="pw"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="type"/>
+            <arg direction="out" type="u" name="retry_count"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_facility () -->
+        <method name="GetFacility">
+            <arg direction="in" type="i" name="type"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="type"/>
+            <arg direction="out" type="i" name="f_status"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_get_lock_info () -->
+        <method name="GetLockInfo">
+            <arg direction="in" type="i" name="type"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="lock_type"/>
+            <arg direction="out" type="i" name="lock_status"/>
+            <arg direction="out" type="u" name="retry_count"/>
+        </method>
+
+        <!--Refer to TAPI API: tapi_sim_req_apdu () -->
+        <method name="ReqApdu">
+            <arg direction="in" type="s" name="apdu"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="s" name="apdu_resp"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_sim_req_atr () -->
+        <method name="ReqAtr">
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="s" name="atr"/>
+        </method>
+
+       <!-- card_status: SIM Card Status -->
+       <property name="card_status" type="a{sv}" access="read"/>
+
+        <!-- sim_type: Type of SIM -->
+        <property name="sim_type" type="i" access="read"/>
+
+        <!-- mcc: Mobile Country Code -->
+        <property name="mcc" type="s" access="read"/>
+
+        <!-- mnc: Mobile Network Code -->
+        <property name="mnc" type="s" access="read"/>
+
+        <!-- msin: Mobile Subscriber Identification Number -->
+        <property name="msin" type="s" access="read"/>
+
+    </interface>
 
 </node>
index 331e892..6928181 100644 (file)
-<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="sim_index"/>
-                       <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"/>
-                       <arg direction="out" type="i" name="resp_index"/>
-               </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)
-                       @3gppType: Type of 3gpp, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA)
-                       @cbEnable: CB service state. If cb_enabled is true then cell broadcast service will be enabled 
-                       @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="net3gppType"/>
-                       <arg direction="out" type="i" name="cbEnable"/>
-                       <arg direction="out" type="i" name="msgIdMaxCount"/>
-                       <arg direction="out" type="i" name="msgIdRangeCount"/>
-                       <arg direction="out" type="aa{sv}" name="msgId"/>
-               </method>
-
-               <!--
-                       SetCbConfig:
-                       @3gppType: Type of 3gpp, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA)
-                       @cbEnable: CB service state. If cb_enabled is true then cell broadcast service will be enabled
-                       @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="net3gppType"/>
-                       <arg direction="in" type="i" name="cbEnable"/>
-                       <arg direction="in" type="i" name="msgIdMaxCount"/>
-                       <arg direction="in" type="i" name="msgIdRangeCount"/>
-                       <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)
+<?xml version="1.0" encoding="UTF-8" ?>
 
-                       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>
-
-               <!--
-                       IncommingEtwsMsg:
-                        @cbMsgType: ETWS message type. PRIMARY, SECONDARY_GSM, SECONDARY_UMTS
-                        @msgLength: Size of the array which is actual TPDU message
-                        @tpdu: ETWS message data[Refer 3GPP TS 23.041 9.4.1
-
-                       This is an unsolicited Incoming cell broadcast message
-               -->
-               <signal name="IncommingEtwsMsg">
-                       <arg type="i" name="etwsMsgType"/>
-                       <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>
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 
+<node>
+  <interface name="org.tizen.telephony.Sms">
+
+    <!-- Refer to TAPI API: tapi_sms_send() -->
+    <method name="Send">
+      <arg direction="in" type="b" name="more_msgs"/>
+      <arg direction="in" type="a{sv}" name="sca"/>
+      <arg direction="in" type="s" name="tpdu"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_read_sms_in_sim() -->
+    <method name="ReadInSim">
+      <arg direction="in" type="u" name="index"/>
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="i" name="status"/>
+      <arg direction="out" type="a{sv}" name="sca"/>
+      <arg direction="out" type="s" name="tpdu"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_write_sms_in_sim() -->
+    <method name="WriteInSim">
+      <arg direction="in" type="i" name="status"/>
+      <arg direction="in" type="a{sv}" name="sca"/>
+      <arg direction="in" type="s" name="tpdu"/>
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="index"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_delete_sms_in_sim() -->
+    <method name="DeleteInSim">
+      <arg direction="in" type="u" name="index"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_get_count() -->
+    <method name="GetCount">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="total_count"/>
+      <arg direction="out" type="u" name="used_count"/>
+      <arg direction="out" type="au" name="index_list"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_set_cb_config() -->
+    <method name="SetCbConfig">
+      <arg direction="in" type="b" name="cb_enabled"/>
+      <arg direction="in" type="u" name="msg_id_range_cnt"/>
+      <arg direction="in" type="aa{sv}" name="msg_ids"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_get_cb_config() -->
+    <method name="GetCbConfig">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="b" name="cb_enabled"/>
+      <arg direction="out" type="u" name="msg_id_range_cnt"/>
+      <arg direction="out" type="aa{sv}" name="msg_ids"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_get_parameters() -->
+    <method name="GetParameters">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="u" name="count"/>
+      <arg direction="out" type="aa{sv}" name="params"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_set_parameters() -->
+    <method name="SetParameters">
+      <arg direction="in" type="u" name="index"/>
+      <arg direction="in" type="a{sv}" name="sca"/>
+      <arg direction="in" type="q" name="vp"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_send_deliver_report() -->
+    <method name="SendDeliverReport">
+      <arg direction="in" type="i" name="report"/>
+      <arg direction="in" type="a{sv}" name="sca"/>
+      <arg direction="in" type="s" name="tpdu"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_set_sca() -->
+    <method name="SetSca">
+      <arg direction="in" type="a{sv}" name="sca"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_get_sca() -->
+    <method name="GetSca">
+      <arg direction="out" type="i" name="result"/>
+      <arg direction="out" type="a{sv}" name="sca"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_set_memory_status() -->
+    <method name="SetMemoryStatus">
+      <arg direction="in" type="b" name="available"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TAPI API: tapi_sms_set_message_status() -->
+    <method name="SetMessageStatus">
+      <arg direction="in" type="u" name="index"/>
+      <arg direction="in" type="i" name="status"/>
+      <arg direction="out" type="i" name="result"/>
+    </method>
+
+    <!-- Refer to TEL_NOTI_SMS_INCOM_MSG event -->
+    <signal name="IncomingMsg">
+      <arg type="a{sv}" name="sca"/>
+      <arg type="s" name="tpdu"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_SMS_CB_INCOM_MSG event -->
+    <signal name="IncomingCbMsg">
+      <arg type="i" name="cb_type"/>
+      <arg type="s" name="cb_data"/>
+    </signal>
+
+    <!-- Refer to TEL_NOTI_SMS_ETWS_INCOM_MSG event -->
+    <signal name="IncomingEtwsMsg">
+      <arg type="i" name="etws_type"/>
+      <arg type="s" name="etws_data"/>
+    </signal>
+
+    <!-- Caches memory available status -->
+    <property name="SimMemoryStatus" type="b" access="read"/>
+
+    <!-- Caches service init status -->
+    <property name="InitStatus" type="b" access="read"/>
+
+  </interface>
 </node>
index 912d74b..6ece3e5 100644 (file)
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!DOCTYPE node PUBLIC
+  "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+  "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+
 <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>
-
-               <signal name="ReleaseComplete">
-                       <arg type="i" name="data_len"/>
-                       <arg type="v" name="data"/>
-               </signal>
-
-       </interface>
+    <interface name="org.tizen.telephony.Ss">
+
+        <!-- Refer to TAPI API: tapi_ss_set_barring () -->
+        <method name="SetBarring">
+            <arg direction="in" type="i" name="class"/>
+            <arg direction="in" type="b" name="enable"/>
+            <arg direction="in" type="i" name="type"/>
+            <arg direction="in" type="s" name="pwd"/>
+            <arg direction="out" type="i" name="result"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_get_barring_status () -->
+        <method name="GetBarringStatus">
+            <arg direction="in" type="i" name="class"/>
+            <arg direction="in" type="i" name="type"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="u" name="record_num"/>
+            <arg direction="out" type="aa{sv}" name="records"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_change_barring_password () -->
+        <method name="ChangeBarringPassword">
+            <arg direction="in" type="s" name="old_pwd"/>
+            <arg direction="in" type="s" name="new_pwd"/>
+            <arg direction="out" type="i" name="result"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_set_forwarding () -->
+        <method name="SetForwarding">
+            <arg direction="in" type="i" name="class"/>
+            <arg direction="in" type="i" name="mode"/>
+            <arg direction="in" type="i" name="condition"/>
+            <arg direction="in" type="s" name="number"/>
+            <arg direction="in" type="u" name="wait_time"/>
+            <arg direction="out" type="i" name="result"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_get_forwarding_status () -->
+        <method name="GetForwardingStatus">
+           <arg direction="in" type="i" name="class"/>
+           <arg direction="in" type="i" name="condition"/>
+           <arg direction="out" type="i" name="result"/>
+           <arg direction="out" type="u" name="record_num"/>
+           <arg direction="out" type="aa{sv}" name="records"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_set_waiting () -->
+        <method name="SetWaiting">
+           <arg direction="in" type="i" name="class"/>
+           <arg direction="in" type="b" name="enable"/>
+           <arg direction="out" type="i" name="result"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_get_waiting_status () -->
+        <method name="GetWaitingStatus">
+           <arg direction="in" type="i" name="class"/>
+           <arg direction="out" type="i" name="result"/>
+           <arg direction="out" type="u" name="record_num"/>
+           <arg direction="out" type="aa{sv}" name="records"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_set_cli () -->
+        <method name="SetCli">
+            <arg direction="in" type="i" name="type"/>
+            <arg direction="in" type="i" name="status"/>
+            <arg direction="out" type="i" name="result"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_get_cli_status () -->
+        <method name="GetCliStatus">
+            <arg direction="in" type="i" name="type"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="type"/>
+            <arg direction="out" type="i" name="net_status"/>
+            <arg direction="out" type="i" name="dev_status"/>
+        </method>
+
+        <!-- Refer to TAPI API: tapi_ss_send_ussd_request () -->
+        <method name="SendUssdRequest">
+            <arg direction="in" type="i" name="type"/>
+            <arg direction="in" type="s" name="str"/>
+            <arg direction="out" type="i" name="result"/>
+            <arg direction="out" type="i" name="type"/>
+            <arg direction="out" type="i" name="status"/>
+            <arg direction="out" type="s" name="str"/>
+        </method>
+
+        <!-- Refer to TEL_NOTI_SS_USSD event -->
+        <signal name="NotifyUssd">
+            <arg type="i" name="status"/>
+            <arg type="s" name="str"/>
+        </signal>
+
+    </interface>
 
 </node>
index b39731e..f4cc549 100644 (file)
@@ -1,29 +1,30 @@
-%define major 0
-%define minor 1
-%define patchlevel 218
-Name: tel-plugin-dbus_tapi
-Summary: dbus-tapi plugin for telephony
-Version:    %{major}.%{minor}.%{patchlevel}
-Release:    1
-Group:      System/Libraries
-License:    Apache-2.0
-Source0:    tel-plugin-dbus_tapi-%{version}.tar.gz
+%define major 3
+%define minor 0
+%define patchlevel 1
+
+Name:           tel-plugin-dbus_tapi
+Version:        %{major}.%{minor}.%{patchlevel}
+Release:        1
+License:        Apache-2.0
+Summary:        dbus-tapi plugin for telephony
+Group:          System/Libraries
+Source0:        tel-plugin-dbus_tapi-%{version}.tar.gz
 Source1001:    tel-plugin-dbus_tapi.manifest
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
 BuildRequires:  cmake
-BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(gobject-2.0)
-BuildRequires:  pkgconfig(gio-2.0)
-BuildRequires:  pkgconfig(gio-unix-2.0)
-BuildRequires:  pkgconfig(tcore)
-BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(aul)
-BuildRequires:  pkgconfig(appsvc)
-BuildRequires:  pkgconfig(security-server)
 BuildRequires:  python
 BuildRequires:  python-xml
+BuildRequires:  pkgconfig(appsvc)
+BuildRequires:  pkgconfig(aul)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(gio-2.0)
+BuildRequires:  pkgconfig(gio-unix-2.0)
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(gobject-2.0)
 BuildRequires:  pkgconfig(libtzplatform-config)
+BuildRequires:  pkgconfig(security-server)
+BuildRequires:  pkgconfig(tcore)
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
 
 %description
 dbus-tapi plugin for telephony
diff --git a/sat-manager/include/sat_manager.h b/sat-manager/include/sat_manager.h
new file mode 100644 (file)
index 0000000..6584970
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 SAT_MANAGER_H_
+#define SAT_MANAGER_H_
+
+#include <tcore.h>
+#include <co_sat.h>
+
+#include "dtapi_sat.h"
+#include "dtapi_util.h"
+
+typedef union {
+       TelSatDisplayTextTlv displayTextInd; /**<       Parsed proactive command info from TLV to Telephony data type - display text    */
+       TelSatGetInkeyTlv getInkeyInd; /**<     Parsed proactive command info from TLV to Telephony data type - getInkey        */
+       TelSatGetInputTlv getInputInd; /**<     Parsed proactive command info from TLV to Telephony data type - getInput        */
+       TelSatPlayToneTlv play_tone;
+       TelSatSetupMenuTlv setupMenuInd; /**<   Parsed proactive command info from TLV to Telephony data type - setup menu      */
+       TelSatSelectItemTlv selectItemInd; /**< Parsed proactive command info from TLV to Telephony data type - select item     */
+       TelSatSendSmsTlv sendSMSInd;
+       TelSatSendSsTlv send_ss;
+       TelSatSendUssdTlv send_ussd;
+       TelSatSetupCallTlv setup_call;
+       TelSatRefreshTlv refresh;
+       TelSatProvideLocalInfoTlv provide_local_info;
+       TelSatSetupIdleModeTextTlv idle_mode;
+       TelSatSendDtmfTlv send_dtmf;
+       TelSatLanguageNotificationTlv language_notification;
+       TelSatLaunchBrowserTlv launch_browser;
+       TelSatOpenChannelTlv open_channel;
+       TelSatCloseChannelTlv close_channel;
+       TelSatReceiveChannelTlv receive_data;
+       TelSatSendChannelTlv send_data;
+       TelSatGetChannelStatusTlv get_channel_status;
+} TelSatManagerProactiveData;
+
+/**
+ * This structure defines the Command Queue Info.
+ */
+typedef struct {
+       TelSatProactiveCmdType cmd_type; /**<Type of Command*/
+       int cmd_id; /**<Command Id*/
+       TelSatManagerProactiveData cmd_data; /**<Proactive Cmd Ind Info*/
+} SatManagerQueueData;
+
+typedef struct {
+       char *cp_name;
+       gpointer cached_sat_main_menu;
+} SatCachedData;
+
+typedef struct {
+       Server *server;
+       SatCachedData *data;
+       GHashTable *objects;
+       GDBusObjectManagerServer *manager;
+       GSList *cached_data;
+} DtapiSatPrivateData;
+
+typedef struct
+{
+       TcorePlugin *plugin;
+       TcorePlugin *comm_plugin;
+} DtapiSatPluginsInfo;
+
+/*================================================================================================*/
+// sat-manager init / deinit
+void sat_manager_init(TcorePlugin *plugin, GHashTable *objects, Server *server, GDBusObjectManagerServer *manager);
+void sat_manager_deinit(TcorePlugin *plugin);
+
+// queue handling
+void sat_manager_init_queue();
+gboolean sat_manager_remove_cmd_by_id(int cmd_id);
+
+//application request handling
+gboolean sat_manager_handle_user_confirm(DtapiSatPluginsInfo *plugins_info, GVariant *user_confirm_data);
+gboolean sat_manager_handle_app_exec_result(TcorePlugin *plugin, gint command_id, gint command_type, GVariant *exec_result);
+gboolean sat_manager_handle_ui_display_status(DtapiSatPluginsInfo *plugins_info, gint command_id, gboolean display_status);
+gboolean sat_manager_handle_event_download_envelop(int event_type,  int src_dev, int dest_dev, TelSatEnvelopEventDownloadTlv *evt_download, GVariant *download_data);
+gboolean sat_manager_update_language(TcorePlugin *plugin, TcorePlugin *comm_plugin, GVariant *language_noti);
+
+//proactive command processing
+GVariant *sat_manager_extracting_setup_menu_info(TcorePlugin *plugin, TcorePlugin *comm_plugin, TelSatSetupMenuTlv* setup_menu_tlv);
+GVariant *sat_manager_display_text_noti(TcorePlugin *plugin, TelSatDisplayTextTlv* display_text_tlv, int decode_error);
+GVariant *sat_manager_select_item_noti(TcorePlugin *plugin, TelSatSelectItemTlv* select_item_tlv, int decode_error);
+GVariant *sat_manager_get_inkey_noti(TcorePlugin *plugin, TelSatGetInkeyTlv* get_inkey_tlv, int decode_error);
+GVariant *sat_manager_get_input_noti(TcorePlugin *plugin, TelSatGetInputTlv* get_input_tlv, int decode_error);
+GVariant *sat_manager_play_tone_noti(TcorePlugin *plugin, TelSatPlayToneTlv* play_tone_tlv);
+GVariant *sat_manager_send_sms_noti(TcorePlugin *plugin, TelSatSendSmsTlv* send_sms_tlv);
+GVariant *sat_manager_send_ss_noti(TcorePlugin *plugin, TelSatSendSsTlv* send_ss_tlv);
+GVariant *sat_manager_send_ussd_noti(TcorePlugin *plugin, TelSatSendUssdTlv* send_ussd_tlv);
+GVariant *sat_manager_setup_call_noti(TcorePlugin *plugin, TelSatSetupCallTlv* setup_call_tlv);
+GVariant *sat_manager_setup_event_list_noti(TcorePlugin *plugin, TelSatSetupEventListTlv *event_list_tlv);
+GVariant *sat_manager_setup_idle_mode_text_noti(TcorePlugin *plugin, TelSatSetupIdleModeTextTlv *idle_mode_tlv);
+GVariant *sat_manager_open_channel_noti(TcorePlugin *plugin, TelSatOpenChannelTlv *open_channel_tlv);
+GVariant *sat_manager_close_channel_noti(TcorePlugin *plugin, TelSatCloseChannelTlv *close_channel_tlv);
+GVariant *sat_manager_receive_data_noti(TcorePlugin *plugin, TelSatReceiveChannelTlv *receive_data_tlv);
+GVariant *sat_manager_send_data_noti(TcorePlugin *plugin, TelSatSendChannelTlv *send_data_tlv);
+GVariant *sat_manager_get_channel_status_noti(TcorePlugin *plugin, TelSatGetChannelStatusTlv *get_channel_status_tlv);
+GVariant *sat_manager_refresh_noti(TcorePlugin *plugin, TelSatRefreshTlv *refresh_tlv);
+void sat_manager_more_time_noti(TcorePlugin *plugin, TelSatMoreTimeTlv *more_time_tlv);
+GVariant* sat_manager_send_dtmf_noti(TcorePlugin *plugin, TelSatSendDtmfTlv *send_dtmf_tlv);
+GVariant* sat_manager_launch_browser_noti(TcorePlugin *plugin, TelSatLaunchBrowserTlv *launch_browser_tlv);
+GVariant* sat_manager_provide_local_info_noti(TcorePlugin *plugin, TcorePlugin *comm_plugin, TelSatProvideLocalInfoTlv *provide_local_info_tlv);
+GVariant* sat_manager_language_notification_noti(TcorePlugin *plugin, TelSatLanguageNotificationTlv *language_notification_tlv);
+gboolean sat_manager_processing_unsupport_proactive_command(TcorePlugin *plugin, TelSatUnsupportCommandTlv *unsupport_tlv);
+gboolean sat_manager_handle_sat_ui_launch_fail(TcorePlugin *plugin, TelSatNotiProactiveData *p_ind);
+
+#endif /* SAT_MANAGER_H_ */
diff --git a/sat-manager/include/sat_ui_support.h b/sat-manager/include/sat_ui_support.h
new file mode 100644 (file)
index 0000000..5fc72a2
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 SAT_UI_SUPPORT_H_
+#define SAT_UI_SUPPORT_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+
+#include <tcore.h>
+#include <storage.h>
+#include <server.h>
+#include <co_sat.h>
+
+#include "dtapi_sat.h"
+
+gboolean sat_ui_support_terminate_sat_ui(void);
+gboolean sat_ui_support_launch_call_application(TelSatProactiveCmdType cmd_type, GVariant *data);
+gboolean sat_ui_support_launch_browser_application(TelSatProactiveCmdType cmd_type, GVariant *data);
+gboolean sat_ui_support_launch_ciss_application(TelSatProactiveCmdType cmd_type, GVariant *data);
+gboolean sat_ui_support_launch_setting_application(TelSatProactiveCmdType cmd_type, GVariant *data);
+gboolean sat_ui_support_launch_sat_ui(TelSatProactiveCmdType cmd_type, GVariant *data);
+gboolean sat_ui_support_create_desktop_file(const gchar *title);
+gboolean sat_ui_support_remove_desktop_file(void);
+gboolean sat_ui_support_exec_bip(GDBusConnection *connection, const gchar *path, TelSatProactiveCmdType cmd_type, GVariant *data);
+gboolean sat_ui_support_exec_evtdw(GDBusConnection *connection, const gchar *path, TelSatProactiveCmdType cmd_type, GVariant *data);
+gboolean sat_ui_support_storage_init(Server *server);
+
+#endif /* SAT_UI_SUPPORT_H_ */
diff --git a/sat-manager/src/sat_manager.c b/sat-manager/src/sat_manager.c
new file mode 100644 (file)
index 0000000..8be56b5
--- /dev/null
@@ -0,0 +1,5054 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 <sys/time.h>
+#include <glib-object.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <storage.h>
+#include <hal.h>
+#include <communicator.h>
+#include <core_object.h>
+#include <queue.h>
+#include <util.h>
+#include <dtapi_call.h>
+#include <dtapi_sim.h>
+
+#include "generated-code.h"
+#include "sat_manager.h"
+#include "sat_ui_support.h"
+
+#define TEL_SAT_DEF_CMD_Q_MAX 10
+#define TEL_SAT_TIME_OUT 30000
+#define TEL_SAT_DELAY_TO_CLEAN_MSG 15000
+#define TEL_SAT_DEF_CMD_Q_MAX 10
+#define TEL_SAT_DEF_CMD_Q_MIN 0
+
+#define TEL_SAT_CMD_Q_CHECK(index) \
+       if (index < TEL_SAT_DEF_CMD_Q_MIN || index > TEL_SAT_DEF_CMD_Q_MAX-1) { warn("invalid index!!"); return FALSE; }
+
+static SatManagerQueueData *sat_queue[TEL_SAT_DEF_CMD_Q_MAX] = {NULL, };
+
+static guchar _convert_decimal_to_bcd(int dec)
+{
+       int tmp1, tmp0;
+       guchar tmp3;
+
+       tmp1 = dec/10;
+       tmp0 = dec - tmp1*10;
+       tmp3 = tmp0 << 4;
+       tmp3 += tmp1;
+
+       dbg("input decimal(%d), bcd(%d%d), endian(%x)", dec, tmp1, tmp0, tmp3);
+       return tmp3;
+}
+
+static const gchar *_convert_sim_lang_to_string(TelSimLanguagePreferenceCode lang)
+{
+       dbg("convert lang(%d)", lang);
+       switch (lang) {
+               case TEL_SIM_LP_GERMAN:
+                       return "de_DE.UTF-8";
+               case TEL_SIM_LP_ENGLISH:
+                       return "en_GB.UTF-8";
+               case TEL_SIM_LP_ITALIAN:
+                       return "it_IT.UTF-8";
+               case TEL_SIM_LP_FRENCH:
+                       return "fr_FR.UTF-8";
+               case TEL_SIM_LP_SPANISH:
+                       return "es_ES.UTF-8";
+               case TEL_SIM_LP_DUTCH:
+                       return "nl_NL.UTF-8";
+               case TEL_SIM_LP_SWEDISH:
+                       return "sv_SE.UTF-8";
+               case TEL_SIM_LP_DANISH:
+                       return "da_DK.UTF-8";
+               case TEL_SIM_LP_PORTUGUESE:
+                       return "pt_PT.UTF-8";
+               case TEL_SIM_LP_FINNISH:
+                       return "fi_FI.UTF-8";
+               case TEL_SIM_LP_NORWEGIAN:
+                       return "nb_NO.UTF-8";
+               case TEL_SIM_LP_GREEK:
+                       return "el_GR.UTF-8";
+               case TEL_SIM_LP_TURKISH:
+                       return "tr_TR.UTF-8";
+               case TEL_SIM_LP_HUNGARIAN:
+                       return "hu_HU.UTF-8";
+               case TEL_SIM_LP_POLISH:
+                       return "pl_PL.UTF-8";
+               case TEL_SIM_LP_KOREAN:
+                       return "ko_KR.UTF-8";
+               case TEL_SIM_LP_CHINESE:
+                       return "zh_CH.UTF-8";
+               case TEL_SIM_LP_RUSSIAN:
+                       return "ru_RU.UTF-8";
+               case TEL_SIM_LP_JAPANESE:
+                       return "ja_JP.UTF-8";
+               default:
+                       return NULL;
+       }
+       return NULL;
+}
+
+static TelSimLanguagePreferenceCode _convert_string_to_sim_lang(const gchar* lang_str)
+{
+       dbg("convert lang(%s)", lang_str);
+
+       if (g_str_equal(lang_str, "de_DE.UTF-8") == TRUE) {
+               return TEL_SIM_LP_GERMAN;
+       }
+       else if (g_str_equal(lang_str, "en_GB.UTF-8") == TRUE) {
+               return TEL_SIM_LP_ENGLISH;
+       }
+       else if (g_str_equal(lang_str, "it_IT.UTF-8") == TRUE) {
+               return TEL_SIM_LP_ITALIAN;
+       }
+       else if (g_str_equal(lang_str, "fr_FR.UTF-8") == TRUE) {
+               return TEL_SIM_LP_FRENCH;
+       }
+       else if (g_str_equal(lang_str, "es_ES.UTF-8") == TRUE) {
+               return TEL_SIM_LP_SPANISH;
+       }
+       else if (g_str_equal(lang_str, "nl_NL.UTF-8") == TRUE) {
+               return TEL_SIM_LP_DUTCH;
+       }
+       else if (g_str_equal(lang_str, "sv_SE.UTF-8") == TRUE) {
+               return TEL_SIM_LP_SWEDISH;
+       }
+       else if (g_str_equal(lang_str, "da_DK.UTF-8") == TRUE) {
+               return TEL_SIM_LP_DANISH;
+       }
+       else if (g_str_equal(lang_str, "pt_PT.UTF-8") == TRUE) {
+               return TEL_SIM_LP_PORTUGUESE;
+       }
+       else if (g_str_equal(lang_str, "fi_FI.UTF-8") == TRUE) {
+               return TEL_SIM_LP_FINNISH;
+       }
+       else if (g_str_equal(lang_str, "nb_NO.UTF-8") == TRUE) {
+               return TEL_SIM_LP_NORWEGIAN;
+       }
+       else if (g_str_equal(lang_str, "el_GR.UTF-8") == TRUE) {
+               return TEL_SIM_LP_GREEK;
+       }
+       else if (g_str_equal(lang_str, "tr_TR.UTF-8") == TRUE) {
+               return TEL_SIM_LP_TURKISH;
+       }
+       else if (g_str_equal(lang_str, "hu_HU.UTF-8") == TRUE) {
+               return TEL_SIM_LP_HUNGARIAN;
+       }
+       else if (g_str_equal(lang_str, "pl_PL.UTF-8") == TRUE) {
+               return TEL_SIM_LP_POLISH;
+       }
+       else if (g_str_equal(lang_str, "ko_KR.UTF-8") == TRUE) {
+               return TEL_SIM_LP_KOREAN;
+       }
+       else if (g_str_equal(lang_str, "zh_CH.UTF-8") == TRUE) {
+               return TEL_SIM_LP_CHINESE;
+       }
+       else if (g_str_equal(lang_str, "ru_RU.UTF-8") == TRUE) {
+               return TEL_SIM_LP_RUSSIAN;
+       }
+       else if (g_str_equal(lang_str, "ja_JP.UTF-8") == TRUE) {
+               return TEL_SIM_LP_JAPANESE;
+       }
+
+       dbg("there is no matched language");
+       return TEL_SIM_LP_LANG_UNSPECIFIED;
+}
+
+static unsigned int _get_time_in_ms(TelSatDurationInfo *dr)
+{
+       switch (dr->time_unit) {
+               case TEL_SAT_TIME_UNIT_MINUTES:
+                       return (unsigned int)dr->time_interval * 60000;
+               case TEL_SAT_TIME_UNIT_SECONDS:
+                       return (unsigned int)dr->time_interval * 1000;
+               case TEL_SAT_TIME_UNIT_TENTHS_OF_SECONDS:
+                       return (unsigned int)dr->time_interval * 100;
+               case TEL_SAT_TIME_UNIT_RESERVED:
+               default:
+                       return 0;
+       }
+}
+
+static int _get_queue_empty_index(void)
+{
+       int cnt = 0;
+       int i;
+       int index = -1;
+
+       for(i =0; i<TEL_SAT_DEF_CMD_Q_MAX ; i++) {
+               if (sat_queue[i]) {
+                       dbg("index[%d] is being used",i);
+                       cnt++;
+               }
+       }
+       for(i =0; i<TEL_SAT_DEF_CMD_Q_MAX ; i++) {
+               if (!sat_queue[i]) {
+                       dbg("found empty slot [%p] at index [%d]", sat_queue[i] ,i);
+                       index = i;
+                       break;
+               }
+       }
+       dbg("[SAT] SAT Command Queue current length [%d], MAX [%d]. \n", cnt, TEL_SAT_DEF_CMD_Q_MAX);
+       return index;
+}
+
+static gboolean _push_data(SatManagerQueueData *cmd_obj)
+{
+       SatManagerQueueData *item;
+       int index = cmd_obj->cmd_id;
+
+       TEL_SAT_CMD_Q_CHECK(index);
+
+       if (sat_queue[index]) {
+               err("[SAT] sat_queue[%d] is not null [%p].\n", sat_queue[index]);
+               return FALSE;
+       }
+
+       item = g_new0(SatManagerQueueData, 1);
+
+       if (!item) {
+               err("[SAT] FAILED TO ALLOC QUEUE ITEM!\n");
+               return FALSE;
+       }
+
+       memcpy((void*)item, (void*)cmd_obj, sizeof(SatManagerQueueData));
+       sat_queue[index] = item;
+       dbg("push data to queue at index[%d], [%p].\n",index, item);
+       return TRUE;
+}
+
+static gboolean _pop_nth_data(SatManagerQueueData *cmd_obj, int command_id)
+{
+       SatManagerQueueData *item;
+       int index = command_id;
+
+       TEL_SAT_CMD_Q_CHECK(index);
+
+       if (!sat_queue[index]) {
+               dbg("[SAT] sat_queue[%d] is null !!\n", index);
+               return FALSE;
+       }
+
+       item = sat_queue[index];
+
+       memcpy((void*)cmd_obj, (void*)item, sizeof(SatManagerQueueData));
+       dbg("pop data from queue at index[%d],[%p].\n",index, item);
+       sat_queue[index] = NULL;
+       g_free(item);
+       return TRUE;
+}
+
+static gboolean _peek_nth_data(SatManagerQueueData *cmd_obj, int command_id)
+{
+       SatManagerQueueData *item = NULL;
+       int index = command_id;
+
+       TEL_SAT_CMD_Q_CHECK(index);
+
+       if (!sat_queue[index]) {
+               err("[SAT] sat_queue[%d] is null !!\n", index);
+               return FALSE;
+       }
+
+       item = sat_queue[index];
+       memcpy((void*)cmd_obj, (void*)item, sizeof(SatManagerQueueData));
+       dbg("peek data from queue at index[%d],[%p].\n",index, item);
+       return TRUE;
+}
+
+static void on_response_sat_manager_send_terminal_response
+       (gint result, const void *data, void *cb_data)
+{
+       dbg("result = [%d]", result);
+
+       if (result != TEL_SAT_RESULT_SUCCESS) {
+               err("Terminal response sending failed");
+       } else {
+               dbg("Terminal response successfully sent to SIM");
+       }
+}
+
+static TelReturn sat_manager_send_terminal_response(TcorePlugin *plugin, TelSatRequestTerminalResponseData *tr)
+{
+       TelReturn result;
+
+       dbg("Entry");
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SAT_REQ_TERMINAL_RESPONSE, tr,
+                                                                                  sizeof(TelSatRequestTerminalResponseData), on_response_sat_manager_send_terminal_response, NULL);
+
+       if (result != TEL_RETURN_SUCCESS) {
+               err("Unable to dispatch request to modem plugin");
+       }
+
+       return result;
+}
+
+void sat_manager_init_queue()
+{
+       int i;
+       dbg("Enter");
+       for(i=0;i<TEL_SAT_DEF_CMD_Q_MAX;i++) {
+               sat_queue[i] = NULL;
+       }
+}
+
+static gboolean sat_manager_enqueue_cmd(SatManagerQueueData *cmd_obj)
+{
+       int id;
+
+       id = _get_queue_empty_index();
+       if (id < 0) {
+               err("Fail to get empty index.\n");
+               return FALSE;
+       }
+       cmd_obj->cmd_id = id;
+       return _push_data(cmd_obj);
+}
+
+static gboolean sat_manager_dequeue_cmd_by_id(SatManagerQueueData *cmd_obj, int cmd_id)
+{
+       return _pop_nth_data(cmd_obj, cmd_id);
+}
+
+static gboolean sat_manager_queue_peek_data_by_id(SatManagerQueueData *cmd_obj, int command_id)
+{
+       return _peek_nth_data(cmd_obj, command_id);
+}
+
+static gboolean sat_manager_check_availiable_event_list(TelSatSetupEventListTlv *event_list_info)
+{
+       gboolean rv = TRUE;
+       int index = 0;
+
+       for(index = 0; index < event_list_info->event_list.event_list_cnt; index++) {
+               if (event_list_info->event_list.evt_list[index] == TEL_SAT_EVENT_USER_ACTIVITY) {
+                       dbg("do user activity");
+               }
+               else if (event_list_info->event_list.evt_list[index] == TEL_SAT_EVENT_IDLE_SCREEN_AVAILABLE) {
+                       dbg("do idle screen");
+               }
+               else if (event_list_info->event_list.evt_list[index] == TEL_SAT_EVENT_LANGUAGE_SELECTION) {
+                       dbg("do language selection");
+               }
+               else if (event_list_info->event_list.evt_list[index] == TEL_SAT_EVENT_BROWSER_TERMINATION) {
+                       dbg("do browser termination");
+               }
+               else if (event_list_info->event_list.evt_list[index] == TEL_SAT_EVENT_DATA_AVAILABLE) {
+                       dbg("do data available (bip)");
+               }
+               else if (event_list_info->event_list.evt_list[index] == TEL_SAT_EVENT_CHANNEL_STATUS) {
+                       dbg("do channel status (bip)");
+               }
+               else{
+                       dbg("unmanaged event (%d)", event_list_info->event_list.evt_list[index]);
+                       rv = FALSE;
+               }
+       }
+
+       return rv;
+}
+
+gboolean sat_manager_remove_cmd_by_id(int cmd_id)
+{
+       SatManagerQueueData *item;
+       int index = cmd_id;
+
+       if (!sat_queue[index]) {
+               err("[SAT] sat_queue[%d] is already null !!\n", index);
+               return FALSE;
+       }
+       item = sat_queue[index];
+
+       dbg("remove data from queue at index[%d],[%p].\n",index, item);
+       sat_queue[index] = NULL;
+       g_free(item);
+       return TRUE;
+}
+
+GVariant *sat_manager_extracting_setup_menu_info(TcorePlugin *plugin, TcorePlugin *comm_plugin, TelSatSetupMenuTlv* setup_menu_tlv)
+{
+       GVariant *setup_menu_info = NULL;
+       SatManagerQueueData q_data;
+       DtapiSatPrivateData *sat_data = NULL;
+       gushort title_len = 0;
+       gint command_id = 0, menu_cnt = 0;
+       gboolean menu_present = FALSE, help_info = FALSE, updated = FALSE;
+       gchar main_title[TEL_SAT_ALPHA_ID_LEN_MAX];
+       GVariantBuilder *v_builder = NULL;
+       GVariant *menu_items = NULL;
+
+       dbg("interpreting setup menu notification");
+       memset(&main_title, 0 , TEL_SAT_ALPHA_ID_LEN_MAX);
+
+       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+       if (!sat_data) {
+               err("sat_data is null");
+               return NULL;
+       }
+
+       if ((setup_menu_tlv->icon_id.is_exist)
+                       && (setup_menu_tlv->icon_id.icon_qualifer == TEL_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!setup_menu_tlv->alpha_id.is_exist || setup_menu_tlv->alpha_id.alpha_data_len == 0)) {
+
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = g_new0(TelSatRequestTerminalResponseData, 1);
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+               return NULL;
+       }
+
+       //check menu update
+       if(sat_data->data) {
+               if (sat_data->data->cached_sat_main_menu) {
+                       dbg("main menu info is updated");
+                       updated = TRUE;
+               }
+       }
+
+       //menu helpinfo
+       help_info = setup_menu_tlv->command_detail.cmd_qualifier.setup_menu.help_info;
+
+       //menu presence
+       menu_present = setup_menu_tlv->command_detail.cmd_qualifier.setup_menu.select_preference;
+
+       //menu item count
+       menu_cnt = setup_menu_tlv->menu_item_cnt;
+
+       //check the validation of content
+       if (!menu_cnt || (setup_menu_tlv->menu_item_cnt == 1 && setup_menu_tlv->menu_item[0].text_len == 0)) {
+               //support GCF case 27.22.4.8.1 - 1.1 setup menu
+
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("no menu item");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_SUCCESS_RETURN;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //get title
+       if (setup_menu_tlv->alpha_id.alpha_data_len)
+               tcore_util_convert_str_to_utf8((guchar*)&main_title,(gushort *)&title_len,
+                       setup_menu_tlv->alpha_id.dcs.a_format,
+                       (guchar*)&setup_menu_tlv->alpha_id.alpha_data,
+                       (gushort)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[TEL_SAT_ITEM_TEXT_LEN_MAX + 1];
+
+                       if (!setup_menu_tlv->alpha_id.alpha_data_len)
+                               setup_menu_tlv->alpha_id.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_8BIT_DATA;
+
+                       memset(&item_str, 0 , TEL_SAT_ITEM_TEXT_LEN_MAX + 1);
+                       tcore_util_convert_str_to_utf8((guchar*)&item_str, (gushort *)&item_len,
+                               setup_menu_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&setup_menu_tlv->menu_item[index].text,
+                               (gushort)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[TEL_SAT_ITEM_TEXT_LEN_MAX + 1];
+
+                       if (setup_menu_tlv->alpha_id.alpha_data_len == 0)
+                               setup_menu_tlv->alpha_id.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_8BIT_DATA;
+
+                       memset(&item_str, '\0' , TEL_SAT_ITEM_TEXT_LEN_MAX + 1);
+                       tcore_util_convert_str_to_utf8((guchar*)&item_str, (gushort *)&item_len,
+                               setup_menu_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&setup_menu_tlv->menu_item[index].text,
+                               (gushort)setup_menu_tlv->menu_item[index].text_len);
+
+                       if ( setup_menu_tlv->next_act_ind_list.indicator_list[index] == TEL_SAT_PROATV_CMD_SEND_SMS) {
+                               g_strlcat(item_str," [Send SMS]", 11);
+                       }
+                       else if (setup_menu_tlv->next_act_ind_list.indicator_list[index]== TEL_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]== TEL_SAT_PROATV_CMD_LAUNCH_BROWSER) {
+                               g_strlcat(item_str," [Launch Browser]", 17);
+                       }
+                       else if (setup_menu_tlv->next_act_ind_list.indicator_list[index]== TEL_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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SETUP_MENU;
+       memcpy((void*)&(q_data.cmd_data.setupMenuInd), setup_menu_tlv, sizeof(TelSatSetupMenuTlv));
+       sat_manager_enqueue_cmd(&q_data);
+       command_id = q_data.cmd_id;
+
+       setup_menu_info = g_variant_new("(ibsvibb)", command_id, menu_present, main_title, menu_items,
+                       menu_cnt, help_info, updated);
+
+       return setup_menu_info;
+}
+
+GVariant *sat_manager_display_text_noti(TcorePlugin *plugin, TelSatDisplayTextTlv* display_text_tlv, int decode_error)
+{
+       GVariant *display_text = NULL;
+       SatManagerQueueData 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[TEL_SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting display text notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       if (!display_text_tlv->text.string_length ||
+               (display_text_tlv->text.string_length > 0 && decode_error != TEL_SAT_RESULT_SUCCESS)) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               tr->terminal_rsp_data.display_text.device_id.src = TEL_SAT_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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //user resp required & time_duration
+       if (display_text_tlv->command_detail.cmd_qualifier.display_text.text_clear_type == TEL_SAT_TEXT_WAIT_FOR_USER_TO_CLEAR_MSG) {
+               user_rsp_required = TRUE;
+               duration = TEL_SAT_TIME_OUT;
+       }
+       else{
+               duration = TEL_SAT_DELAY_TO_CLEAN_MSG;
+       }
+
+       //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 == TEL_SAT_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
+       tcore_util_convert_str_to_utf8((guchar*) &text, (gushort *) &text_len,
+                       display_text_tlv->text.dcs.a_format,
+                       (guchar*) &display_text_tlv->text.string,
+                       (gushort) 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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_DISPLAY_TEXT;
+       memcpy((void*)&(q_data.cmd_data.displayTextInd), display_text_tlv, sizeof(TelSatDisplayTextTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatSelectItemTlv* select_item_tlv, int decode_error)
+{
+       GVariant *select_item = NULL;
+       SatManagerQueueData 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[TEL_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 , TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       if (!select_item_tlv->menu_item_cnt || !select_item_tlv->menu_item[0].text_len) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *) calloc(1, sizeof(TelSatRequestTerminalResponseData));
+
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       // help info
+       help_info = select_item_tlv->command_detail.cmd_qualifier.select_item.help_info;
+
+       if (!select_item_tlv->alpha_id.is_exist) {
+               dbg("set the item dcs value to TEL_SAT_ALPHABET_FORMAT_8BIT_DATA");
+               select_item_tlv->alpha_id.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_8BIT_DATA;
+       }
+
+       // select item text
+       if (select_item_tlv->alpha_id.is_exist && select_item_tlv->alpha_id.alpha_data_len > 0)
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               select_item_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&select_item_tlv->alpha_id.alpha_data,
+                               (gushort)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;
+       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[TEL_SAT_ITEM_TEXT_LEN_MAX + 1];
+
+               memset(&item_str, 0 , TEL_SAT_ITEM_TEXT_LEN_MAX + 1);
+
+               tcore_util_convert_str_to_utf8((guchar*) &item_str, (gushort *) &item_len,
+                               select_item_tlv->alpha_id.dcs.a_format,
+                               (guchar*) &select_item_tlv->menu_item[index].text,
+                               (gushort) 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] == TEL_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]== TEL_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]== TEL_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]== TEL_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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SELECT_ITEM;
+       memcpy((void*)&(q_data.cmd_data.selectItemInd), select_item_tlv, sizeof(TelSatSelectItemTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatGetInkeyTlv* get_inkey_tlv, int decode_error)
+{
+       GVariant *get_inkey = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0, key_type = 0, input_character_mode = 0;
+       gint text_len = 0, duration = 0, tmp_duration = 0;
+       gboolean is_numeric = FALSE, is_help_info = FALSE;
+       gchar text[TEL_SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting get inkey notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       if (!get_inkey_tlv->text.string_length ||
+               (get_inkey_tlv->text.string_length > 0 && decode_error != TEL_SAT_RESULT_SUCCESS)) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //key type
+       key_type = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.inkey_type;
+
+       //time duration
+       duration = TEL_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
+       is_numeric = !get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_set;
+
+       //help info
+       is_help_info = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.help_info;
+
+       //text & text len
+       tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                                                               get_inkey_tlv->text.dcs.a_format ,
+                                                               (guchar*)&get_inkey_tlv->text.string,
+                                                               (gushort)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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_GET_INKEY;
+       memcpy((void*)&(q_data.cmd_data.getInkeyInd), get_inkey_tlv, sizeof(TelSatGetInkeyTlv));
+       sat_manager_enqueue_cmd(&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, is_numeric,
+                       is_help_info, text, text_len, duration, icon_id);
+
+       return get_inkey;
+}
+
+GVariant *sat_manager_get_input_noti(TcorePlugin *plugin, TelSatGetInputTlv* get_input_tlv, int decode_error)
+{
+       GVariant *get_input = NULL;
+       SatManagerQueueData 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 is_numeric = FALSE, is_help_info = FALSE, is_echo_input = FALSE;
+       gchar text[TEL_SAT_TEXT_STRING_LEN_MAX], def_text[TEL_SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting get input notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+
+#if GCF //disable the text length prb for GCF
+               if (
+                       (get_input_tlv->text.string_length > 0 && decode_error != TEL_SAT_RESULT_SUCCESS) ||
+                       (!get_input_tlv->rsp_len.max) || (get_input_tlv->rsp_len.min > get_input_tlv->rsp_len.max)) {
+#else
+               if (!get_input_tlv->text.string_length ||
+                       (get_input_tlv->text.string_length > 0 && decode_error != TEL_SAT_RESULT_SUCCESS) ||
+                       (!get_input_tlv->rsp_len.max) || (get_input_tlv->rsp_len.min > get_input_tlv->rsp_len.max)) {
+#endif
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+
+               g_free(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
+       is_numeric = !get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_set;
+
+       //help info
+       is_help_info = get_input_tlv->command_detail.cmd_qualifier.get_input.help_info;
+
+       //echo input
+       is_echo_input = get_input_tlv->command_detail.cmd_qualifier.get_input.me_echo_user_input;
+       dbg("numeric (%d), help info(%d), echo input(%d)", is_numeric, is_help_info, is_echo_input);
+
+       //text & text len
+       if (get_input_tlv->text.string_length) {
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               get_input_tlv->text.dcs.a_format ,
+                               (guchar*)&get_input_tlv->text.string,
+                               (gushort)get_input_tlv->text.string_length);
+               dbg("get input text(%s)",text);
+       }
+       else{
+               memcpy(text,"", 1);
+               text_len = 0;
+       }
+
+       //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) {
+               tcore_util_convert_str_to_utf8((guchar*)&def_text,(gushort *)&def_text_len,
+                               get_input_tlv->text.dcs.a_format ,
+                               (guchar*)&get_input_tlv->default_text.string,
+                               (gushort)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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_GET_INPUT;
+       memcpy((void*)&(q_data.cmd_data.getInputInd), get_input_tlv, sizeof(TelSatGetInputTlv));
+       sat_manager_enqueue_cmd(&q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       get_input = g_variant_new("(iibbbsiiisiv)", command_id, input_character_mode, is_numeric, is_help_info,
+                       is_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(TcorePlugin *plugin, TelSatPlayToneTlv* play_tone_tlv)
+{
+       GVariant *play_tone = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0, tone_type = 0, duration = 0, tmp_duration = 0;
+       gint text_len = 0;
+       gchar text[TEL_SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting play tone notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       if ( (play_tone_tlv->icon_id.is_exist) && ( play_tone_tlv->icon_id.icon_qualifer == TEL_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!play_tone_tlv->alpha_id.is_exist || !play_tone_tlv->alpha_id.alpha_data_len))
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               tr->terminal_rsp_data.play_tone.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               tr->terminal_rsp_data.play_tone.device_id.dest = play_tone_tlv->device_id.src;
+               tr->terminal_rsp_data.play_tone.result_type = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //text and text len
+       if ( play_tone_tlv->alpha_id.is_exist && play_tone_tlv->alpha_id.alpha_data_len) {
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               play_tone_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&play_tone_tlv->alpha_id.alpha_data,
+                               (gushort)play_tone_tlv->alpha_id.alpha_data_len);
+               dbg("play tone ui display text (%s)",text);
+       }
+
+       //tone type
+       tone_type = play_tone_tlv->tone;
+
+       //time duration
+       duration = TEL_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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_PLAY_TONE;
+       memcpy((void*)&(q_data.cmd_data.play_tone), play_tone_tlv, sizeof(TelSatPlayToneTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatSendSmsTlv* send_sms_tlv)
+{
+       GVariant *send_sms = NULL;
+       SatManagerQueueData q_data;
+       int index = 0;
+       gint command_id = 0, ton = 0, npi = 0, tpdu_type = 0;
+       gboolean is_packing_required = FALSE;
+       gint text_len = 0, number_len = 0, tpdu_data_len= 0;
+       gchar text[TEL_SAT_TEXT_STRING_LEN_MAX], dialling_number[TEL_SAT_DIALING_NUMBER_LEN_MAX];
+       GVariantBuilder *builder = NULL;
+       GVariant *tpdu_data = NULL;
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send sms notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+       memset(&dialling_number, 0 , TEL_SAT_DIALING_NUMBER_LEN_MAX);
+
+       if ( (send_sms_tlv->icon_id.is_exist) && ( send_sms_tlv->icon_id.icon_qualifer == TEL_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!send_sms_tlv->alpha_id.is_exist || !send_sms_tlv->alpha_id.alpha_data_len))
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               tr->terminal_rsp_data.send_sms.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               tr->terminal_rsp_data.send_sms.device_id.dest = send_sms_tlv->device_id.src;
+               tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //text and text len
+       if ( send_sms_tlv->alpha_id.is_exist && send_sms_tlv->alpha_id.alpha_data_len) {
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               send_sms_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&send_sms_tlv->alpha_id.alpha_data,
+                               (gushort)send_sms_tlv->alpha_id.alpha_data_len);
+               dbg("send sms ui display text (%s)",text);
+       }
+       else{
+               memcpy(text,"",1);
+               text_len = 0;
+       }
+
+       //packing required
+       is_packing_required = send_sms_tlv->command_detail.cmd_qualifier.cmd_quali_send_sms;
+
+       //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, TEL_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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SEND_SMS;
+       memcpy((void*)&(q_data.cmd_data.sendSMSInd), send_sms_tlv, sizeof(TelSatSendSmsTlv));
+       sat_manager_enqueue_cmd(&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, is_packing_required,
+                       ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
+
+       return send_sms;
+}
+
+GVariant *sat_manager_send_ss_noti(TcorePlugin *plugin, TelSatSendSsTlv* send_ss_tlv)
+{
+       GVariant *send_ss = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0, ton = 0, npi = 0;
+       gint text_len = 0, ss_str_len = 0;
+       gchar text[TEL_SAT_TEXT_STRING_LEN_MAX], ss_string[TEL_SAT_SS_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send ss notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+       memset(&ss_string, 0 , TEL_SAT_SS_STRING_LEN_MAX);
+
+       if ( (send_ss_tlv->icon_id.is_exist) && ( send_ss_tlv->icon_id.icon_qualifer == TEL_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!send_ss_tlv->alpha_id.is_exist || !send_ss_tlv->alpha_id.alpha_data_len))
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //text and text len
+       if ( send_ss_tlv->alpha_id.is_exist && send_ss_tlv->alpha_id.alpha_data_len) {
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               send_ss_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&send_ss_tlv->alpha_id.alpha_data,
+                               (gushort)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, TEL_SAT_SS_STRING_LEN_MAX);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SEND_SS;
+       memcpy((void*)&(q_data.cmd_data.send_ss), send_ss_tlv, sizeof(TelSatSendSsTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatSendUssdTlv* send_ussd_tlv)
+{
+       GVariant *send_ussd = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0;
+       guchar dcs = 0;
+       gint text_len = 0, ussd_str_len = 0;
+       gchar text[TEL_SAT_TEXT_STRING_LEN_MAX], ussd_string[TEL_SAT_USSD_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send ussd notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+       memset(&ussd_string, 0 , TEL_SAT_USSD_STRING_LEN_MAX);
+
+       if ( (send_ussd_tlv->icon_id.is_exist) && ( send_ussd_tlv->icon_id.icon_qualifer == TEL_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!send_ussd_tlv->alpha_id.is_exist || !send_ussd_tlv->alpha_id.alpha_data_len))
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //text and text len
+       if ( send_ussd_tlv->alpha_id.is_exist && send_ussd_tlv->alpha_id.alpha_data_len) {
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               send_ussd_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&send_ussd_tlv->alpha_id.alpha_data,
+                               (gushort)send_ussd_tlv->alpha_id.alpha_data_len);
+               dbg("send ussd ui display text (%s)",text);
+       }
+
+       //ussd string
+       dcs = send_ussd_tlv->ussd_string.dsc.raw_dcs;
+       tcore_util_convert_str_to_utf8((guchar*)&ussd_string,(gushort *)&ussd_str_len,
+                               send_ussd_tlv->ussd_string.dsc.a_format,
+                               (guchar*)&send_ussd_tlv->ussd_string.ussd_string,
+                               (gushort)send_ussd_tlv->ussd_string.string_len);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SEND_USSD;
+       memcpy((void*)&(q_data.cmd_data.send_ussd), send_ussd_tlv, sizeof(TelSatSendUssdTlv));
+       sat_manager_enqueue_cmd(&q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       send_ussd = g_variant_new("(isivyis)", command_id, text, text_len, icon_id, dcs, ussd_str_len, ussd_string);
+
+       return send_ussd;
+}
+
+GVariant *sat_manager_setup_call_noti(TcorePlugin *plugin, TelSatSetupCallTlv* setup_call_tlv)
+{
+       GVariant *setup_call = NULL;
+       SatManagerQueueData q_data;
+
+       gint command_id = 0, call_type = 0, confirm_text_len = 0, text_len = 0, duration = 0;
+       gchar confirm_text[TEL_SAT_TEXT_STRING_LEN_MAX], text[TEL_SAT_TEXT_STRING_LEN_MAX], call_number[TEL_SAT_DIALING_NUMBER_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting setup call notification");
+       memset(&confirm_text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+       memset(&call_number, 0 , TEL_SAT_DIALING_NUMBER_LEN_MAX);
+
+       if (setup_call_tlv->duration.time_interval > 0)
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT] redial is not supported.\n");
+
+               tr = g_new0(TelSatRequestTerminalResponseData, 1);
+               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(TelSatCmdDetailInfo));
+               tr->terminal_rsp_data.setup_call.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               tr->terminal_rsp_data.setup_call.device_id.dest = setup_call_tlv->device_id.src;
+               tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_BEYOND_ME_CAPABILITIES;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+               return NULL;
+       }
+
+       //check for subaddress field
+       if (setup_call_tlv->subaddress.subaddress_len > 0)
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT] Sub address is not supported > 0)");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               tr->terminal_rsp_data.setup_call.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               tr->terminal_rsp_data.setup_call.device_id.dest = setup_call_tlv->device_id.src;
+               tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_BEYOND_ME_CAPABILITIES;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+               return NULL;
+       }
+
+       //call type
+       call_type = setup_call_tlv->command_detail.cmd_qualifier.setup_call;
+
+       //call display data
+       if (setup_call_tlv->call_setup_alpha_id.alpha_data_len != 0) {
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               setup_call_tlv->call_setup_alpha_id.dcs.a_format,
+                               (guchar*)&setup_call_tlv->call_setup_alpha_id.alpha_data,
+                               (gushort)setup_call_tlv->call_setup_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);
+
+       if (setup_call_tlv->user_confirm_alpha_id.alpha_data_len != 0) {
+               tcore_util_convert_str_to_utf8((guchar*)&confirm_text,(gushort *)&confirm_text_len,
+                               setup_call_tlv->user_confirm_alpha_id.dcs.a_format,
+                               (guchar*)&setup_call_tlv->user_confirm_alpha_id.alpha_data,
+                               (gushort)setup_call_tlv->user_confirm_alpha_id.alpha_data_len);
+       }
+
+       //call number
+       if (setup_call_tlv->address.ton == TEL_SAT_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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SETUP_CALL;
+       memcpy((void*)&(q_data.cmd_data.setup_call), setup_call_tlv, sizeof(TelSatSetupCallTlv));
+       sat_manager_enqueue_cmd(&q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       setup_call = g_variant_new("(isisivisi)", command_id, confirm_text, confirm_text_len, text, text_len, icon_id, call_type, call_number, duration);
+
+       return setup_call;
+}
+
+GVariant *sat_manager_setup_event_list_noti(TcorePlugin *plugin, TelSatSetupEventListTlv *event_list_tlv)
+{
+       GVariant *event_list = NULL;
+       int index = 0;
+       gboolean rv = FALSE;
+       gint event_cnt = 0;
+       GVariantBuilder *builder = NULL;
+       GVariant *evt_list = NULL;
+       TelSatRequestTerminalResponseData *tr = NULL;
+
+       dbg("interpreting event list notification");
+
+       //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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       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 = TEL_SAT_RESULT_SUCCESS_RETURN;
+       tr->terminal_rsp_data.setup_event_list.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+       rv = sat_manager_check_availiable_event_list(event_list_tlv);
+       sat_manager_send_terminal_response(plugin, tr);
+       g_free(tr);
+
+       return event_list;
+}
+
+GVariant *sat_manager_setup_idle_mode_text_noti(TcorePlugin *plugin, TelSatSetupIdleModeTextTlv *idle_mode_tlv)
+{
+       GVariant *idle_mode = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0;
+       gint text_len = 0;
+       gchar text[TEL_SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting setup idle mode text notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       if ( ((idle_mode_tlv->icon_id.is_exist) && ( idle_mode_tlv->icon_id.icon_qualifer == TEL_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY))
+                       && idle_mode_tlv->text.string_length == 0 )
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+               return NULL;
+       }
+
+       tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                       idle_mode_tlv->text.dcs.a_format,
+                       (guchar*)&idle_mode_tlv->text.string,
+                       (gushort)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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT;
+       memcpy((void*)&(q_data.cmd_data.idle_mode), idle_mode_tlv, sizeof(TelSatSetupIdleModeTextTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatOpenChannelTlv *open_channel_tlv)
+{
+       GVariant *open_channel = NULL;
+       SatManagerQueueData 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[TEL_SAT_ALPHA_ID_LEN_MAX], dest_address[TEL_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 , TEL_SAT_ALPHA_ID_LEN_MAX);
+       memset(&dest_address, 0 , TEL_SAT_OTHER_ADDR_LEN_MAX);
+
+       //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)
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               open_channel_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&open_channel_tlv->alpha_id.alpha_data,
+                               (gushort)open_channel_tlv->alpha_id.alpha_data_len);
+       dbg("open channel text(%s)",text);
+
+       //buffer size
+       buffer_size = open_channel_tlv->buffer_size[0];
+       buffer_size = buffer_size << 8;
+       buffer_size += open_channel_tlv->buffer_size[1];
+       //memcpy(&buffer_size, open_channel_tlv->buffer_size.size, sizeof(guchar)*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 TEL_SAT_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[TEL_SAT_DIALING_NUMBER_LEN_MAX], sub_addr[TEL_SAT_SUB_ADDR_LEN_MAX];
+                       gchar other_address[TEL_SAT_OTHER_ADDR_LEN_MAX];
+                       gchar login[TEL_SAT_TEXT_STRING_LEN_MAX], pwd[TEL_SAT_TEXT_STRING_LEN_MAX];
+
+                       memset(&dialling_number, 0 , TEL_SAT_DIALING_NUMBER_LEN_MAX);
+                       memset(&sub_addr, 0 , TEL_SAT_SUB_ADDR_LEN_MAX);
+                       memset(&other_address, 0 , TEL_SAT_OTHER_ADDR_LEN_MAX);
+                       memset(&login, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+                       memset(&pwd, 0 , TEL_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);
+
+                       tcore_util_convert_str_to_utf8((guchar*) &login, (gushort *) &login_len,
+                                       open_channel_tlv->bearer_detail.cs_bearer.text_user_login.dcs.a_format,
+                                       (guchar*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string,
+                                       (gushort) open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string_length);
+
+                       tcore_util_convert_str_to_utf8((guchar*) &pwd, (gushort *) &pwd_len,
+                                       open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.dcs.a_format,
+                                       (guchar*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string,
+                                       (gushort) 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 TEL_SAT_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[TEL_SAT_NET_ACC_NAM_LEN_MAX];
+                       gchar other_address[TEL_SAT_OTHER_ADDR_LEN_MAX];
+                       gchar login[TEL_SAT_TEXT_STRING_LEN_MAX], pwd[TEL_SAT_TEXT_STRING_LEN_MAX];
+
+                       memset(&network_access_name, 0 , TEL_SAT_NET_ACC_NAM_LEN_MAX);
+                       memset(&other_address, 0 , TEL_SAT_OTHER_ADDR_LEN_MAX);
+                       memset(&login, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+                       memset(&pwd, 0 , TEL_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);
+
+                       tcore_util_convert_str_to_utf8((guchar*) &login, (gushort *) &login_len,
+                                       open_channel_tlv->bearer_detail.ps_bearer.text_user_login.dcs.a_format,
+                                       (guchar*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string,
+                                       (gushort) open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string_length);
+
+                       tcore_util_convert_str_to_utf8((guchar*) &pwd, (gushort *) &pwd_len,
+                                       open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.dcs.a_format,
+                                       (guchar*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string,
+                                       (gushort) 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 TEL_SAT_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[TEL_SAT_OTHER_ADDR_LEN_MAX];
+                       gchar login[TEL_SAT_TEXT_STRING_LEN_MAX], pwd[TEL_SAT_TEXT_STRING_LEN_MAX];
+
+                       memset(&other_address, 0 , TEL_SAT_OTHER_ADDR_LEN_MAX);
+                       memset(&login, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+                       memset(&pwd, 0 , TEL_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);
+
+                       tcore_util_convert_str_to_utf8((guchar*) &login, (gushort *) &login_len,
+                                       open_channel_tlv->bearer_detail.default_bearer.text_user_login.dcs.a_format,
+                                       (guchar*) &open_channel_tlv->bearer_detail.default_bearer.text_user_login.string,
+                                       (gushort) open_channel_tlv->bearer_detail.default_bearer.text_user_login.string_length);
+
+                       tcore_util_convert_str_to_utf8((guchar*) &pwd, (gushort *) &pwd_len,
+                                       open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
+                                       (guchar*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
+                                       (gushort) 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 TEL_SAT_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[TEL_SAT_REMOTE_ENTITY_ADDR_LEN_MAX];
+                       gchar pwd[TEL_SAT_TEXT_STRING_LEN_MAX];
+
+                       memset(&remote_address, 0 , TEL_SAT_REMOTE_ENTITY_ADDR_LEN_MAX);
+                       memset(&pwd, 0 , TEL_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);
+
+                       tcore_util_convert_str_to_utf8((guchar*) &pwd, (gushort *) &pwd_len,
+                                                                                       open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
+                                                                                       (guchar*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
+                                                                                       (gushort) 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:
+                       err("invalid bearer data");
+                       return NULL;
+       }//end of switch
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_OPEN_CHANNEL;
+       memcpy((void*)&(q_data.cmd_data.open_channel), open_channel_tlv, sizeof(TelSatOpenChannelTlv));
+       sat_manager_enqueue_cmd(&q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       //execute bip
+       //sat_ui_support_exec_bip();
+
+       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(TcorePlugin *plugin, TelSatCloseChannelTlv *close_channel_tlv)
+{
+       GVariant *close_channel = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0, channel_id = 0;
+       gint text_len = 0;
+       gchar text[TEL_SAT_ALPHA_ID_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting close channel notification");
+       memset(&text, 0 , TEL_SAT_ALPHA_ID_LEN_MAX);
+
+       //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)
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               close_channel_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&close_channel_tlv->alpha_id.alpha_data,
+                               (gushort)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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_CLOSE_CHANNEL;
+       memcpy((void*)&(q_data.cmd_data.close_channel), close_channel_tlv, sizeof(TelSatCloseChannelTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatReceiveChannelTlv *receive_data_tlv)
+{
+       GVariant *receive_data = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0, channel_id = 0;
+       gint text_len = 0, channel_data_len = 0;
+       gchar text[TEL_SAT_ALPHA_ID_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting receive data notification");
+       memset(&text, 0 , TEL_SAT_ALPHA_ID_LEN_MAX);
+
+       //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)
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               receive_data_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&receive_data_tlv->alpha_id.alpha_data,
+                               (gushort)receive_data_tlv->alpha_id.alpha_data_len);
+       dbg("receive data text(%s)",text);
+
+       channel_data_len = receive_data_tlv->channel_data_len;
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_RECEIVE_DATA;
+       memcpy((void*)&(q_data.cmd_data.receive_data), receive_data_tlv, sizeof(TelSatReceiveChannelTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatSendChannelTlv *send_data_tlv)
+{
+       GVariant *send_data = NULL;
+       SatManagerQueueData 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[TEL_SAT_ALPHA_ID_LEN_MAX];
+       GVariantBuilder *builder = NULL;
+       GVariant *channel_data = NULL;
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send data notification");
+       memset(&text, 0 , TEL_SAT_ALPHA_ID_LEN_MAX);
+
+       //send data immediately
+       send_data_immediately = send_data_tlv->command_detail.cmd_qualifier.cmd_quali_send_data;
+
+       //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)
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               send_data_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&send_data_tlv->alpha_id.alpha_data,
+                               (gushort)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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SEND_DATA;
+       memcpy((void*)&(q_data.cmd_data.send_data), send_data_tlv, sizeof(TelSatSendChannelTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatGetChannelStatusTlv *get_channel_status_tlv)
+{
+       GVariant *get_channel_status = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0;
+
+       dbg("interpreting get channel status notification");
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_GET_CHANNEL_STATUS;
+       memcpy((void*)&(q_data.cmd_data.get_channel_status), get_channel_status_tlv, sizeof(TelSatGetChannelStatusTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatRefreshTlv *refresh_tlv)
+{
+       GVariant *refresh = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0;
+       gint refresh_type =0;
+       GVariantBuilder *builder = NULL;
+       GVariant *file_list = NULL;
+
+       dbg("interpreting refresh notification");
+
+       refresh_type = refresh_tlv->command_detail.cmd_qualifier.refresh;
+
+       builder = g_variant_builder_new(G_VARIANT_TYPE ("ai"));
+       /* TODO Use TelSimFileID from tel_sim.h */
+       /*
+       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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_REFRESH;
+       memcpy((void*)&(q_data.cmd_data.refresh), refresh_tlv, sizeof(TelSatRefreshTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatMoreTimeTlv *more_time_tlv)
+{
+       TelSatRequestTerminalResponseData *tr = NULL;
+
+       dbg("interpreting more time notification");
+
+       //send TR - does not need from application's response
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       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 = TEL_SAT_RESULT_SUCCESS_RETURN;
+       tr->terminal_rsp_data.more_time.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+       sat_manager_send_terminal_response(plugin, tr);
+       g_free(tr);
+
+       return;
+}
+
+GVariant *sat_manager_send_dtmf_noti(TcorePlugin *plugin, TelSatSendDtmfTlv *send_dtmf_tlv)
+{
+       GVariant *send_dtmf = NULL;
+       SatManagerQueueData q_data;
+
+       gint command_id = 0;
+       gint text_len =0, dtmf_str_len =0;
+       gchar text[TEL_SAT_TEXT_STRING_LEN_MAX], dtmf_str[TEL_SAT_DTMF_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting send dtmf notification");
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+       memset(&dtmf_str, 0 , TEL_SAT_DTMF_STRING_LEN_MAX);
+
+       if ( (send_dtmf_tlv->icon_id.is_exist) && ( send_dtmf_tlv->icon_id.icon_qualifer == TEL_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!send_dtmf_tlv->alpha_id.is_exist || !send_dtmf_tlv->alpha_id.alpha_data_len))
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //text and text len
+       if ( send_dtmf_tlv->alpha_id.is_exist && send_dtmf_tlv->alpha_id.alpha_data_len) {
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               send_dtmf_tlv->alpha_id.dcs.a_format,
+                               (guchar*)&send_dtmf_tlv->alpha_id.alpha_data,
+                               (gushort)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, TEL_SAT_DTMF_STRING_LEN_MAX);
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_SEND_DTMF;
+       memcpy((void*)&(q_data.cmd_data.send_dtmf), send_dtmf_tlv, sizeof(TelSatSendDtmfTlv));
+       sat_manager_enqueue_cmd(&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(TcorePlugin *plugin, TelSatLaunchBrowserTlv *launch_browser_tlv)
+{
+       GVariant *launch_browser = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0;
+       gint browser_launch_type = 0, browser_id = 0;
+       gint url_len =0, text_len =0, gateway_proxy_len =0;
+       gchar url[TEL_SAT_URL_LEN_MAX], text[TEL_SAT_TEXT_STRING_LEN_MAX], gateway_proxy[TEL_SAT_TEXT_STRING_LEN_MAX];
+       GVariant *icon_id = NULL;
+
+       dbg("interpreting launch browser notification");
+       memset(&url, 0 , TEL_SAT_URL_LEN_MAX);
+       memset(&text, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+       memset(&gateway_proxy, 0 , TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       if ( (launch_browser_tlv->user_confirm_icon_id.is_exist) && ( launch_browser_tlv->user_confirm_icon_id.icon_qualifer == TEL_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY)
+                       && (!launch_browser_tlv->user_confirm_alpha_id.is_exist || !launch_browser_tlv->user_confirm_alpha_id.alpha_data_len))
+       {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               dbg("[SAT]  exceptional case to fix gcf case 2.4 command not understood");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+               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(TelSatCmdDetailInfo));
+               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 = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return NULL;
+       }
+
+       //browser launch type
+       browser_launch_type = launch_browser_tlv->command_detail.cmd_qualifier.launch_browser;
+
+       //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) {
+                       tcore_util_convert_str_to_utf8((guchar*)&gateway_proxy,(gushort *)&gateway_proxy_len,
+                                       launch_browser_tlv->gateway_proxy_text.dcs.a_format,
+                                       (guchar*)&launch_browser_tlv->gateway_proxy_text.string,
+                                       (gushort)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) {
+               tcore_util_convert_str_to_utf8((guchar*)&text,(gushort *)&text_len,
+                               launch_browser_tlv->user_confirm_alpha_id.dcs.a_format,
+                               (guchar*)&launch_browser_tlv->user_confirm_alpha_id.alpha_data,
+                               (gushort)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(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_LAUNCH_BROWSER;
+       memcpy((void*)&(q_data.cmd_data.launch_browser), launch_browser_tlv, sizeof(TelSatLaunchBrowserTlv));
+       sat_manager_enqueue_cmd(&q_data);
+       command_id = q_data.cmd_id;
+
+       icon_id = g_variant_new("()");
+
+       launch_browser = g_variant_new("(iiisisisiv)",
+                       command_id, browser_launch_type, 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(TcorePlugin *plugin, TcorePlugin *comm_plugin, TelSatProvideLocalInfoTlv *provide_local_info_tlv)
+{
+       GVariant *provide_info = NULL;
+       gint info_type =0;
+       TelSatRequestTerminalResponseData *tr = NULL;
+
+       dbg("interpreting provide local info notification");
+
+       provide_info = g_variant_new("(i)", info_type);
+
+       //send TR - does not need from application's response
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       tr->cmd_number = provide_local_info_tlv->command_detail.cmd_num;
+       tr->cmd_type = provide_local_info_tlv->command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.provide_local_info.command_detail, &provide_local_info_tlv->command_detail, sizeof(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.provide_local_info.device_id.src = provide_local_info_tlv->device_id.dest;
+       tr->terminal_rsp_data.provide_local_info.device_id.dest = provide_local_info_tlv->device_id.src;
+       tr->terminal_rsp_data.provide_local_info.other_info = TRUE;
+
+       info_type = provide_local_info_tlv->command_detail.cmd_qualifier.provide_local_info;
+
+       switch (info_type) {
+               case TEL_SAT_LOCAL_INFO_DATE_TIME_AND_TIMEZONE:{
+                       int err = 0; int gmt = 0, n_flg = 0;
+                       /* TODO confirm timezone and timeval struct types */
+                       struct timezone c_tz;
+                       struct timeval c_time;
+
+                       time_t time_val;
+                       struct tm time_info;
+
+                       time(&time_val);
+
+                       tzset();
+                       err = gettimeofday(&c_time, &c_tz);
+                       localtime_r(&time_val, &time_info);
+
+                       //set the time information
+                       tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.year =
+                               _convert_decimal_to_bcd(time_info.tm_year+1900-2000);
+
+                       tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.month =
+                                       _convert_decimal_to_bcd(time_info.tm_mon+1);
+
+                       tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.day =
+                                       _convert_decimal_to_bcd(time_info.tm_mday);
+
+                       tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.hour =
+                                       _convert_decimal_to_bcd(time_info.tm_hour);
+
+                       tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.minute =
+                                       _convert_decimal_to_bcd(time_info.tm_min);
+
+                       tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.second =
+                                       _convert_decimal_to_bcd(time_info.tm_sec);
+
+                       gmt = c_tz.tz_minuteswest/60;
+                       if (gmt < 0) {
+                               gmt = gmt * -1;
+                               n_flg = 1;
+                       }
+
+                       if (err != 0) {
+                               tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.time_zone = 0xFF;
+                       }
+                       else{
+                               tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.time_zone =
+                                       _convert_decimal_to_bcd(gmt);
+
+                               if (n_flg == 1) {
+                                       tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.time_zone += 0x80;
+                               }
+
+                               if (time_info.tm_isdst > 0) {
+                                       tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.time_zone += 0x40;
+                               }
+                       }
+
+                       tr->terminal_rsp_data.provide_local_info.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       tr->terminal_rsp_data.provide_local_info.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+               } break;
+               case TEL_SAT_LOCAL_INFO_LANGUAGE:{
+                       DtapiSatPrivateData *sat_data;
+                       static TcoreStorage *strg;
+                       gchar *lang_str = NULL;
+                       TelSimLanguagePreferenceCode lang_type = TEL_SIM_LP_LANG_UNSPECIFIED;
+
+                       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+                       if (!sat_data) {
+                               err("sat_data is null");
+                               return NULL;
+                       }
+
+                       tr->terminal_rsp_data.provide_local_info.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       tr->terminal_rsp_data.provide_local_info.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+                       strg = tcore_server_find_storage(sat_data->server, "vconf");
+                       lang_str = tcore_storage_get_string(strg, STORAGE_KEY_LANGUAGE_SET);
+                       if (lang_str)
+                               lang_type = _convert_string_to_sim_lang(lang_str);
+
+                       tr->terminal_rsp_data.provide_local_info.other.language = lang_type;
+               } break;
+               default :{
+                       tr->terminal_rsp_data.provide_local_info.other_info = FALSE;
+                       tr->terminal_rsp_data.provide_local_info.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.provide_local_info.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+               } break;
+       }
+
+       sat_manager_send_terminal_response(plugin, tr);
+       g_free(tr);
+
+       return provide_info;
+}
+
+GVariant *sat_manager_language_notification_noti(TcorePlugin *plugin, TelSatLanguageNotificationTlv *language_notification_tlv)
+{
+       GVariant *language_noti = NULL;
+       SatManagerQueueData q_data;
+       gint command_id = 0;
+       gint language =0;
+       gboolean is_specified = FALSE;
+
+       dbg("interpreting langauge notification");
+
+       if (language_notification_tlv->command_detail.cmd_qualifier.cmd_quali_language_notification == TRUE) {
+               is_specified = TRUE;
+               language = language_notification_tlv->language;
+       } else {
+               is_specified = FALSE;
+               language = TEL_SIM_LP_LANG_UNSPECIFIED;
+       }
+
+       //enqueue data and generate cmd_id
+       memset(&q_data, 0x00, sizeof(SatManagerQueueData));
+       q_data.cmd_type = TEL_SAT_PROATV_CMD_LANGUAGE_NOTIFICATION;
+       memcpy((void*)&(q_data.cmd_data.language_notification), language_notification_tlv, sizeof(TelSatLanguageNotificationTlv));
+       sat_manager_enqueue_cmd(&q_data);
+       command_id = q_data.cmd_id;
+
+       language_noti = g_variant_new("(iib)", command_id, language, is_specified);
+
+       return language_noti;
+}
+
+gboolean sat_manager_processing_unsupport_proactive_command(TcorePlugin *plugin, TelSatUnsupportCommandTlv *unsupport_tlv)
+{
+       TelSatRequestTerminalResponseData tr;
+
+       dbg("[SAT] unsupport proactive command (%d)", unsupport_tlv->command_detail.cmd_type);
+
+       memset(&tr, 0x00, sizeof(TelSatRequestTerminalResponseData));
+       tr.cmd_number = unsupport_tlv->command_detail.cmd_num;
+       tr.cmd_type = unsupport_tlv->command_detail.cmd_type;
+
+       memcpy((void*)&tr.terminal_rsp_data.unsupport_cmd.command_detail, &unsupport_tlv->command_detail, sizeof(TelSatCmdDetailInfo));
+       tr.terminal_rsp_data.unsupport_cmd.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr.terminal_rsp_data.unsupport_cmd.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+       tr.terminal_rsp_data.unsupport_cmd.result_type = TEL_SAT_RESULT_BEYOND_ME_CAPABILITIES;
+
+       sat_manager_send_terminal_response(plugin, &tr);
+
+       return TRUE;
+}
+
+gboolean sat_manager_handle_sat_ui_launch_fail(TcorePlugin *plugin, TelSatNotiProactiveData *p_ind)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       TelSatRequestTerminalResponseData tr;
+
+       dbg("[SAT] proactive command (%d)", p_ind->cmd_type);
+
+       memset(&tr, 0x00, sizeof(TelSatRequestTerminalResponseData));
+       tr.cmd_number = p_ind->cmd_number;
+       tr.cmd_type = p_ind->cmd_type;
+
+       switch (p_ind->cmd_type) {
+               case TEL_SAT_PROATV_CMD_DISPLAY_TEXT: {
+                       memcpy((void*)&tr.terminal_rsp_data.display_text.command_detail, &p_ind->proactive_ind_data.display_text.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.display_text.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.display_text.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_SELECT_ITEM: {
+                       memcpy((void*)&tr.terminal_rsp_data.select_item.command_detail, &p_ind->proactive_ind_data.select_item.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.select_item.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.select_item.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.select_item.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_GET_INKEY: {
+                       memcpy((void*)&tr.terminal_rsp_data.get_inkey.command_detail, &p_ind->proactive_ind_data.get_inkey.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.get_inkey.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.get_inkey.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.get_inkey.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_GET_INPUT: {
+                       memcpy((void*)&tr.terminal_rsp_data.get_input.command_detail, &p_ind->proactive_ind_data.get_input.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.get_input.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.get_input.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.get_input.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_PLAY_TONE: {
+                       memcpy((void*)&tr.terminal_rsp_data.play_tone.command_detail, &p_ind->proactive_ind_data.play_tone.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.play_tone.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.play_tone.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.play_tone.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_SEND_SMS: {
+                       memcpy((void*)&tr.terminal_rsp_data.send_sms.command_detail, &p_ind->proactive_ind_data.send_sms.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.send_sms.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.send_sms.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_SEND_SS: {
+                       memcpy((void*)&tr.terminal_rsp_data.send_ss.command_detail, &p_ind->proactive_ind_data.send_ss.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.send_ss.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.send_ss.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.send_ss.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_SEND_USSD: {
+                       memcpy((void*)&tr.terminal_rsp_data.send_ussd.command_detail, &p_ind->proactive_ind_data.send_ussd.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.send_ussd.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.send_ussd.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.send_ussd.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_SETUP_CALL: {
+                       memcpy((void*)&tr.terminal_rsp_data.setup_call.command_detail, &p_ind->proactive_ind_data.setup_call.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.setup_call.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.setup_call.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT: {
+                       memcpy((void*)&tr.terminal_rsp_data.setup_idle_mode_text.command_detail, &p_ind->proactive_ind_data.setup_idle_mode_text.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.setup_idle_mode_text.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.setup_idle_mode_text.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.setup_idle_mode_text.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_OPEN_CHANNEL: {
+                       memcpy((void*)&tr.terminal_rsp_data.open_channel.command_detail, &p_ind->proactive_ind_data.open_channel.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.open_channel.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.open_channel.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.open_channel.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               case TEL_SAT_PROATV_CMD_LAUNCH_BROWSER: {
+                       memcpy((void*)&tr.terminal_rsp_data.launch_browser.command_detail, &p_ind->proactive_ind_data.launch_browser.command_detail, sizeof(TelSatCmdDetailInfo));
+                       tr.terminal_rsp_data.launch_browser.device_id.src = TEL_SAT_DEVICE_ID_ME;
+                       tr.terminal_rsp_data.launch_browser.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+                       tr.terminal_rsp_data.launch_browser.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+               } break;
+               default:
+                       dbg("unsupported command.");
+                       break;
+       }
+
+       rv = sat_manager_send_terminal_response(plugin, &tr);
+       if (rv != TEL_RETURN_SUCCESS)
+               return FALSE;
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_setup_menu_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               dbg("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] setup menu result data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+
+       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] Response: [0x%02x]", resp);
+
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       tr->terminal_rsp_data.setup_menu.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       if (q_data.cmd_data.setupMenuInd.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.setup_menu.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+                       tr->terminal_rsp_data.setup_menu.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.setup_menu.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.setup_menu.me_problem_type = TEL_SAT_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 = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       err("[SAT] wrong result from app exec resp(%d)", resp);
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_display_text_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] display text result data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.display_text.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.display_text.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       tr->terminal_rsp_data.display_text.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.display_text.result_type = TEL_SAT_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;
+                       err("[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 == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+               tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_play_tone_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] display text result data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.play_tone.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.play_tone.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       tr->terminal_rsp_data.play_tone.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       if (q_data.cmd_data.play_tone.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.play_tone.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       tr->terminal_rsp_data.play_tone.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.play_tone.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.play_tone.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER:
+                       tr->terminal_rsp_data.play_tone.result_type = TEL_SAT_RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       tr->terminal_rsp_data.play_tone.me_problem_type = TEL_SAT_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;
+                       err("[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 == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+               tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+static gboolean _sat_manager_handle_send_sms_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] send sms data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.send_sms.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.send_sms.device_id.dest = q_data.cmd_data.sendSMSInd.device_id.src;
+
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       if (q_data.cmd_data.sendSMSInd.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       break;
+
+               case TEL_SAT_RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
+                       tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
+                       tr->terminal_rsp_data.send_sms.cc_problem_type = TEL_SAT_CC_PROBLEM_ACTION_NOT_ALLOWED;
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_BEYOND_ME_CAPABILITIES:
+                       tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_BEYOND_ME_CAPABILITIES;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME:
+                       tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME:
+                       tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_SMS_RP_ERROR:
+                       tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_SMS_RP_ERROR;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.send_sms.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_sms.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+
+/*     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(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem, ss_cause, call_ctrl_problem, ss_str_len;
+       gchar *ss_string;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+       //call ctrl action, result data object, text
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] send ss data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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, "(iiisii)", &resp, &me_problem, &ss_cause, &ss_string, &ss_str_len, &call_ctrl_problem);
+
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.send_ss.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.send_ss.device_id.dest = q_data.cmd_data.send_ss.device_id.src;
+
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       tr->terminal_rsp_data.send_ss.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       if (q_data.cmd_data.send_ss.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.send_ss.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       if (ss_str_len > 0 && ss_string != NULL) {
+                               memcpy(&tr->terminal_rsp_data.send_ss.text.dcs, &q_data.cmd_data.send_ss.alpha_id.dcs, sizeof(TelSatDataCodingSchemeInfo));
+                               memcpy((void*)tr->terminal_rsp_data.send_ss.text.string, ss_string, ss_str_len);
+                               tr->terminal_rsp_data.send_ss.text.string_length = ss_str_len;
+                       }
+                       break;
+
+               case TEL_SAT_RESULT_SS_RETURN_ERROR:
+                       tr->terminal_rsp_data.send_ss.result_type = TEL_SAT_RESULT_SS_RETURN_ERROR;
+                       tr->terminal_rsp_data.send_ss.ss_problem = ss_cause;
+                       break;
+
+               case TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_ss.result_type = TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_ss.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.send_ss.result_type = TEL_SAT_RESULT_SS_RETURN_ERROR;
+                       tr->terminal_rsp_data.send_ss.ss_problem = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+       g_free(tr);
+
+       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(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem, ss_cause, ussd_str_len;
+       GVariant *ussd_str = NULL;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+       //call ctrl action, result data object, text, result2, text2
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] send ss data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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@vi)", &resp, &me_problem, &ss_cause, &ussd_str, &ussd_str_len);
+
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.send_ussd.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.send_ussd.device_id.dest = q_data.cmd_data.send_ussd.device_id.src;
+
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       tr->terminal_rsp_data.send_ussd.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       if (q_data.cmd_data.send_ussd.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.send_ussd.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       if (ussd_str_len > 0 && ussd_str) {
+                               int index = 0;
+                               guchar data;
+                               GVariantIter *iter = NULL;
+                               GVariant *intermediate = NULL;
+
+                               intermediate = g_variant_get_variant(ussd_str);
+                               dbg("ussd string format(%s)", g_variant_get_type_string(intermediate));
+
+                               g_variant_get(intermediate, "ay", &iter);
+                               while ( g_variant_iter_loop (iter, "y", &data)) {
+                                       dbg("index(%d) data(%c)", index, data);
+
+                                       if (index == 0) {
+                                               tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs = (data & 0x0F);
+                                       }
+                                       else{
+                                               tr->terminal_rsp_data.send_ussd.text.string[index-1] = data;
+                                       }
+
+                                       index++;
+                               }
+                               g_variant_iter_free(iter);
+                               g_variant_unref(intermediate);
+
+                               tr->terminal_rsp_data.send_ussd.text.string_length = index-1;
+                       }
+                       break;
+
+               case TEL_SAT_RESULT_SS_RETURN_ERROR:
+               case TEL_SAT_RESULT_USSD_RETURN_ERROR:{
+                       tr->terminal_rsp_data.send_ussd.result_type = TEL_SAT_RESULT_USSD_RETURN_ERROR;
+                       if(ss_cause == TEL_SS_RESULT_UNKONWN_ALPHABET)
+                               tr->terminal_rsp_data.send_ussd.ussd_problem = TEL_SAT_USSD_PROBLEM_UNKNOWN_ALPHABET;
+                       else
+                               tr->terminal_rsp_data.send_ussd.ussd_problem = TEL_SAT_USSD_PROBLEM_NO_SPECIFIC_CAUSE;
+                       }break;
+
+               case TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_ussd.result_type = TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_ussd.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_ussd.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_ussd.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.send_ussd.result_type = TEL_SAT_RESULT_USSD_RETURN_ERROR;
+                       tr->terminal_rsp_data.send_ussd.ussd_problem = TEL_SAT_USSD_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+       g_free(tr);
+
+       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(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem, cc_problem, call_cause;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] setup call data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.setup_call.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.setup_call.device_id.dest = q_data.cmd_data.setup_call.device_id.src;
+
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       if (q_data.cmd_data.setup_call.call_setup_icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = TEL_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = me_problem;
+                       break;
+
+               case TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:{
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+                       if(call_cause == TEL_CALL_RESULT_NETWORK_BUSY)
+                               tr->terminal_rsp_data.setup_call.network_problem_type = TEL_SAT_NETWORK_PROBLEM_USER_BUSY;
+                       else
+                               tr->terminal_rsp_data.setup_call.network_problem_type = TEL_SAT_NETWORK_PROBLEM_NO_SPECIFIC_CAUSE;
+               }break;
+
+               case TEL_SAT_RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN:
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = TEL_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_BEYOND_ME_CAPABILITIES:
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_BEYOND_ME_CAPABILITIES;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = TEL_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = TEL_SAT_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(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+static gboolean _sat_manager_handle_setup_idle_mode_text_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] send ss data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = g_new0(TelSatRequestTerminalResponseData, 1);
+       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(TelSatCmdDetailInfo));
+       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 TEL_SAT_RESULT_SUCCESS_RETURN:
+                       tr->terminal_rsp_data.setup_idle_mode_text.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       if (q_data.cmd_data.idle_mode.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.setup_idle_mode_text.result_type = TEL_SAT_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(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+       g_free(tr);
+
+       sat_ui_support_terminate_sat_ui();
+
+       return result;
+}
+
+static gboolean sat_manager_handle_open_channel_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_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;
+
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] open channel data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+
+       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 TEL_SAT_RESULT_SUCCESS_RETURN:
+               case TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case TEL_SAT_RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.open_channel.me_problem_type = me_problem;
+                       break;
+
+               case TEL_SAT_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(guchar)*2);
+       tr->terminal_rsp_data.open_channel.buffer_size[0] = buffer_size >> 8;
+       tr->terminal_rsp_data.open_channel.buffer_size[1] = buffer_size & 0xFF;
+       dbg("check buffer size[0](0x%x) size[1](0x%x)", tr->terminal_rsp_data.open_channel.buffer_size[0], tr->terminal_rsp_data.open_channel.buffer_size[1]);
+
+       tr->terminal_rsp_data.open_channel.bearer_desc.bearer_type = bearer_type;
+       switch (bearer_type) {
+               case TEL_SAT_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 TEL_SAT_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 TEL_SAT_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((const gchar *)service_record));
+
+               }break;
+               default:
+               break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+static gboolean sat_manager_handle_close_channel_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem, bip_problem;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] close channel data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+
+       tr->terminal_rsp_data.close_channel.device_id.src = TEL_SAT_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 TEL_SAT_RESULT_SUCCESS_RETURN:
+               case TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case TEL_SAT_RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.close_channel.me_problem_type = me_problem;
+                       break;
+
+               case TEL_SAT_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(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+static gboolean sat_manager_handle_receive_data_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem, bip_problem;
+       gint data_str_len, data_len;
+       gboolean other_info;
+       GVariant *received_data;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] receive data data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+
+       tr->terminal_rsp_data.receive_data.device_id.src = TEL_SAT_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 TEL_SAT_RESULT_SUCCESS_RETURN:
+               case TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case TEL_SAT_RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.receive_data.me_problem_type = me_problem;
+                       break;
+
+               case TEL_SAT_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;
+       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(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+static gboolean sat_manager_handle_send_data_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem, bip_problem;
+       gint data_len;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] send data data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+
+       tr->terminal_rsp_data.send_data.device_id.src = TEL_SAT_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 TEL_SAT_RESULT_SUCCESS_RETURN:
+               case TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case TEL_SAT_RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_data.me_problem_type = me_problem;
+                       break;
+
+               case TEL_SAT_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;
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+static gboolean sat_manager_handle_get_channel_status_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, me_problem, bip_problem;
+       gint channel_id, channel_status, channel_status_info;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] get channel status data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+
+       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 TEL_SAT_RESULT_SUCCESS_RETURN:
+               case TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+               case TEL_SAT_RESULT_SUCCESS_WITH_MISSING_INFO:
+                       //channel status
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+               case TEL_SAT_RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.get_channel_status.me_problem_type = me_problem;
+                       break;
+
+               case TEL_SAT_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(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+static gboolean sat_manager_handle_send_dtmf_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               g_free(tr);
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] get channel status data is null");
+               g_free(tr);
+               return result;
+       }
+
+       if (!plugin) {
+               err("there is no valid plugin at this point");
+               g_free(tr);
+               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.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(TelSatCmdDetailInfo));
+
+       tr->terminal_rsp_data.send_dtmf.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       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 = resp;
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       if (q_data.cmd_data.send_dtmf.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.send_dtmf.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+                       break;
+
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.send_dtmf.me_problem_type = TEL_SAT_ME_PROBLEM_NOT_IN_SPEECH_CALL;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.send_dtmf.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.send_dtmf.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+static gboolean sat_manager_handle_launch_browser_result(TcorePlugin *plugin, gint command_id, GVariant *exec_result)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint resp, browser_problem;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!exec_result) {
+               err("[SAT] get channel status data is null");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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,&browser_problem);
+
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+
+       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;
+
+       tr->terminal_rsp_data.launch_browser.result_type = resp;
+       switch (resp) {
+               case TEL_SAT_RESULT_SUCCESS_RETURN:
+                       if (q_data.cmd_data.launch_browser.user_confirm_icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.launch_browser.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       tr->terminal_rsp_data.launch_browser.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.launch_browser.browser_problem_type = TEL_SAT_BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+               case TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+                       tr->terminal_rsp_data.launch_browser.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.launch_browser.browser_problem_type = TEL_SAT_BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               case TEL_SAT_RESULT_LAUNCH_BROWSER_GENERIC_ERROR_CODE:
+                       tr->terminal_rsp_data.launch_browser.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.launch_browser.browser_problem_type = browser_problem;
+                       break;
+               default:
+                       tr->terminal_rsp_data.launch_browser.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+                       tr->terminal_rsp_data.launch_browser.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.launch_browser.browser_problem_type = TEL_SAT_BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+gboolean sat_manager_handle_app_exec_result(TcorePlugin *plugin, 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 TEL_SAT_PROATV_CMD_SETUP_MENU:
+                       result = _sat_manager_handle_setup_menu_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_DISPLAY_TEXT:
+                       result = _sat_manager_handle_display_text_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_PLAY_TONE:
+                       result = _sat_manager_handle_play_tone_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_SEND_SMS:
+                       result = _sat_manager_handle_send_sms_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_SEND_SS:
+                       result = _sat_manager_handle_send_ss_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_SEND_USSD:
+                       result = _sat_manager_handle_send_ussd_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_SETUP_CALL:
+                       result = _sat_manager_handle_setup_call_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+                       result = _sat_manager_handle_setup_idle_mode_text_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_OPEN_CHANNEL:
+                       result = sat_manager_handle_open_channel_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_CLOSE_CHANNEL:
+                       result = sat_manager_handle_close_channel_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_RECEIVE_DATA:
+                       result = sat_manager_handle_receive_data_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_SEND_DATA:
+                       result = sat_manager_handle_send_data_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_GET_CHANNEL_STATUS:
+                       result = sat_manager_handle_get_channel_status_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_SEND_DTMF:
+                       result = sat_manager_handle_send_dtmf_result(plugin, command_id, resp);
+                       break;
+
+               case TEL_SAT_PROATV_CMD_LAUNCH_BROWSER:
+                       result = sat_manager_handle_launch_browser_result(plugin, command_id, resp);
+                       break;
+
+               default:
+                       err("[SAT] invalid command type(%d)", command_type);
+                       break;
+       }
+
+       sat_ui_support_terminate_sat_ui();
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_menu_select_confirm(TcorePlugin *plugin, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       gint item_id=0;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.select_item.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.select_item.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+
+       switch (confirm_type) {
+               case TEL_SAT_USER_CONFIRM_YES:
+                       tr->terminal_rsp_data.select_item.item_identifier = item_id;
+                       tr->terminal_rsp_data.select_item.other_info = FALSE;
+                       tr->terminal_rsp_data.select_item.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       tr->terminal_rsp_data.select_item.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+                       if (q_data.cmd_data.selectItemInd.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.select_item.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       break;
+
+               case TEL_SAT_USER_CONFIRM_HELP_INFO:
+                       tr->terminal_rsp_data.select_item.item_identifier = item_id;
+                       tr->terminal_rsp_data.select_item.other_info = FALSE;
+                       tr->terminal_rsp_data.select_item.result_type = TEL_SAT_RESULT_HELP_INFO_REQUIRED_BY_USER;
+                       tr->terminal_rsp_data.select_item.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       //TODO ctx->help_requested = TRUE;
+                       break;
+
+               case TEL_SAT_USER_CONFIRM_END:
+                       tr->terminal_rsp_data.select_item.result_type = TEL_SAT_RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       break;
+
+               case TEL_SAT_USER_CONFIRM_NO_OR_CANCEL:
+                       tr->terminal_rsp_data.select_item.result_type = TEL_SAT_RESULT_BACKWARD_MOVE_BY_USER;
+                       break;
+
+               case TEL_SAT_USER_CONFIRM_TIMEOUT:
+                       tr->terminal_rsp_data.select_item.result_type = TEL_SAT_RESULT_NO_RESPONSE_FROM_USER;
+                       break;
+
+               default:
+                       err("not handled value[%d] here", confirm_type);
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_display_text_confirm(TcorePlugin *plugin, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plugin) {
+               err("there is no valid plugin at this point");
+               return result;
+       }
+
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.display_text.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.display_text.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+
+       switch (confirm_type) {
+               case TEL_SAT_USER_CONFIRM_YES: {
+                       tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       tr->terminal_rsp_data.display_text.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+                       if (q_data.cmd_data.displayTextInd.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+               } break;
+
+               case TEL_SAT_USER_CONFIRM_NO_OR_CANCEL:
+                       tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_BACKWARD_MOVE_BY_USER;
+                       break;
+
+               case TEL_SAT_USER_CONFIRM_TIMEOUT:
+                       tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+
+                       if (q_data.cmd_data.displayTextInd.command_detail.cmd_qualifier.display_text.text_clear_type == TEL_SAT_TEXT_WAIT_FOR_USER_TO_CLEAR_MSG )
+                               tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_NO_RESPONSE_FROM_USER;
+
+                       break;
+
+               case TEL_SAT_USER_CONFIRM_END:
+                       tr->terminal_rsp_data.display_text.result_type = TEL_SAT_RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       break;
+
+               case TEL_SAT_USER_CONFIRM_HELP_INFO:
+               default:
+                       err("not handled value[%d] here", confirm_type);
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_get_inkey_confirm(TcorePlugin *plugin, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       guint inkey_data_len = 0;
+       guchar inkey_data[TEL_SAT_TEXT_STRING_LEN_MAX];
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+       memset(inkey_data, 0, TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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 = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.get_inkey.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.get_inkey.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+
+       switch (confirm_type) {
+               case TEL_SAT_USER_CONFIRM_YES:
+                       tr->terminal_rsp_data.get_inkey.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+
+                       if (q_data.cmd_data.getInkeyInd.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.get_inkey.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+                       if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == TEL_SAT_INKEY_TYPE_YES_NO_REQUESTED) {
+                               tr->terminal_rsp_data.get_inkey.text.dcs.m_class = TEL_SAT_MSG_CLASS_RESERVED;
+                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_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 = TEL_SAT_ALPHABET_FORMAT_8BIT_DATA;
+                                       tr->terminal_rsp_data.get_inkey.text.dcs.m_class = TEL_SAT_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 = TEL_SAT_MSG_CLASS_RESERVED;
+
+                                       if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == TEL_SAT_INPUT_ALPHABET_TYPE_SMS_DEFAULT ) {
+                                               guint tmp_len;
+                                               guchar tmp_str[TEL_SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
+
+                                               dbg("sat gsm7 encoding");
+                                               tcore_util_convert_utf8_to_gsm(tmp_str, &tmp_len, inkey_data, inkey_data_len);
+
+                                               packed_data = tcore_util_pack_gsm7bit((const guchar *)tmp_str, tmp_len);
+                                               if (packed_data) {
+                                                       tr->terminal_rsp_data.get_inkey.text.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_8BIT_DATA;
+                                                       tr->terminal_rsp_data.get_inkey.text.string_length = strlen((const gchar *)packed_data);
+                                                       memcpy((void*) tr->terminal_rsp_data.get_inkey.text.string,
+                                                               packed_data, strlen((const gchar *)packed_data));
+
+                                                       g_free(packed_data);
+                                               }
+                                       }
+                                       else if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == TEL_SAT_INPUT_ALPHABET_TYPE_UCS2 ) {
+                                               dbg("UCS2 DATA");
+
+                                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_UCS2;
+                                               tcore_util_convert_utf8_to_ucs2((guchar*)tr->terminal_rsp_data.get_inkey.text.string,
+                                                               (guint *)&tr->terminal_rsp_data.get_inkey.text.string_length,
+                                                               (guchar*)inkey_data, inkey_data_len);
+                                       }
+                                       else {
+                                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_RESERVED;
+                                               dbg("[SAT] invalid DCS[%d]",tr->terminal_rsp_data.get_inkey.text.dcs.a_format);
+                                       }
+                               }
+                       }
+               break;
+
+               case TEL_SAT_USER_CONFIRM_HELP_INFO:
+                       tr->terminal_rsp_data.get_inkey.result_type = TEL_SAT_RESULT_HELP_INFO_REQUIRED_BY_USER;
+                       //TODO ctx->help_requested = TRUE;
+               break;
+
+               case TEL_SAT_USER_CONFIRM_NO_OR_CANCEL:
+                       tr->terminal_rsp_data.get_inkey.result_type = TEL_SAT_RESULT_BACKWARD_MOVE_BY_USER;
+
+                       if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == TEL_SAT_INKEY_TYPE_YES_NO_REQUESTED) {
+                               tr->terminal_rsp_data.get_inkey.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                               tr->terminal_rsp_data.get_inkey.text.dcs.m_class = TEL_SAT_MSG_CLASS_RESERVED;
+                               tr->terminal_rsp_data.get_inkey.text.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_8BIT_DATA;
+                               tr->terminal_rsp_data.get_inkey.text.string_length = 1;
+                               tr->terminal_rsp_data.get_inkey.text.string[0] = 0x00;
+                       }
+               break;
+
+               case TEL_SAT_USER_CONFIRM_TIMEOUT:
+                       tr->terminal_rsp_data.get_inkey.result_type = TEL_SAT_RESULT_NO_RESPONSE_FROM_USER;
+               break;
+
+               case TEL_SAT_USER_CONFIRM_END:
+                       tr->terminal_rsp_data.get_inkey.result_type = TEL_SAT_RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+               break;
+
+               default:
+                       err("not handled value[%d] here", confirm_type);
+               break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_get_input_confirm(TcorePlugin *plugin, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       guint input_data_len = 0;
+       guchar input_data[TEL_SAT_TEXT_STRING_LEN_MAX];
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+       memset(input_data, 0, TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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);
+                       input_data[index] = data;
+                       index++;
+               }
+               g_variant_iter_free(iter);
+               g_variant_unref(inner_gv);
+               input_data_len = index;
+       }
+
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.get_input.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.get_input.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+
+       switch (confirm_type) {
+               case TEL_SAT_USER_CONFIRM_YES:
+                       tr->terminal_rsp_data.get_input.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+                       tr->terminal_rsp_data.get_input.text.dcs.m_class = TEL_SAT_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 == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.get_input.result_type = TEL_SAT_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 = TEL_SAT_ALPHABET_FORMAT_SMS_DEFAULT;
+
+                               if (input_data_len > 0) {
+                                       guint tmp_len;
+                                       guchar tmp_str[TEL_SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
+
+                                       dbg("sat gsm7 encoding");
+                                       tcore_util_convert_utf8_to_gsm(tmp_str, &tmp_len, input_data, input_data_len);
+
+                                       packed_data = tcore_util_pack_gsm7bit((const guchar *)tmp_str, tmp_len);
+                                       if (packed_data) {
+                                               memcpy((void*)tr->terminal_rsp_data.get_input.text.string, packed_data, strlen((const gchar *)packed_data));
+                                               tr->terminal_rsp_data.get_input.text.string_length = strlen((const gchar *)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 == TEL_SAT_INPUT_ALPHABET_TYPE_SMS_DEFAULT) {
+                                       tr->terminal_rsp_data.get_input.text.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_8BIT_DATA;
+                                       tcore_util_convert_utf8_to_gsm((guchar*)tr->terminal_rsp_data.get_input.text.string,
+                                                       (guint *)&tr->terminal_rsp_data.get_input.text.string_length,
+                                                       (guchar *)input_data, input_data_len);
+
+                               }
+                               else if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == TEL_SAT_INPUT_ALPHABET_TYPE_UCS2 ) {
+                                       tr->terminal_rsp_data.get_input.text.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_UCS2;
+                                       tcore_util_convert_utf8_to_ucs2((guchar*)tr->terminal_rsp_data.get_input.text.string,
+                                                       (guint *)&tr->terminal_rsp_data.get_input.text.string_length,
+                                                       (guchar*)input_data, input_data_len);
+
+                               }
+                               else{
+                                       tr->terminal_rsp_data.get_input.text.dcs.a_format = TEL_SAT_ALPHABET_FORMAT_RESERVED;
+                                       dbg("[SAT] invalid DCS[%d]",tr->terminal_rsp_data.get_input.text.dcs.a_format);
+                               }
+                       }
+               break;
+
+               case TEL_SAT_USER_CONFIRM_HELP_INFO:
+                       tr->terminal_rsp_data.get_input.result_type = TEL_SAT_RESULT_HELP_INFO_REQUIRED_BY_USER;
+                       //TODO ctx->help_requested = TRUE;
+               break;
+
+               case TEL_SAT_USER_CONFIRM_NO_OR_CANCEL:
+                       tr->terminal_rsp_data.get_input.result_type = TEL_SAT_RESULT_BACKWARD_MOVE_BY_USER;
+               break;
+
+               case TEL_SAT_USER_CONFIRM_TIMEOUT:
+                       tr->terminal_rsp_data.get_input.result_type = TEL_SAT_RESULT_NO_RESPONSE_FROM_USER;
+               break;
+
+               case TEL_SAT_USER_CONFIRM_END:
+                       tr->terminal_rsp_data.get_input.result_type = TEL_SAT_RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+               break;
+
+               default:
+               break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_setup_call_confirm(TcorePlugin *plugin, TcorePlugin *comm_plugin, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       DtapiSatPrivateData *sat_data = NULL;
+       gboolean result = FALSE;
+       gint input_data_len = 0;
+       gchar input_data[TEL_SAT_TEXT_STRING_LEN_MAX];
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+       memset(input_data, 0, TEL_SAT_TEXT_STRING_LEN_MAX);
+
+       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+       if (!sat_data) {
+               err("sat_data is null");
+               return result;
+       }
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plugin) {
+               err("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);
+                       input_data[index] = data;
+                       index++;
+               }
+               g_variant_iter_free(iter);
+               g_variant_unref(inner_gv);
+               input_data_len = index;
+       }
+
+       tr = g_new0(TelSatRequestTerminalResponseData, 1);
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.setup_call.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.setup_call.device_id.dest = q_data.cmd_data.setup_call.device_id.src;
+
+       switch (confirm_type) {
+               case TEL_SAT_USER_CONFIRM_YES:{
+                       char *path;
+                       TelephonySat *sat;
+                       TelephonyObjectSkeleton *object;
+                       gchar *plg_name = NULL;
+                       GVariant *setup_call = NULL;
+                       gint command_id, call_type, confirmed_text_len, text_len, duration;
+                       gchar *confirmed_text, *text, *call_number;
+                       GVariant *icon_id;
+
+                       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plugin);
+                       if (plg_name) {
+                               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
+                       }
+                       else {
+                               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
+                       }
+                       dbg("path = [%s]", path);
+
+                       object = g_hash_table_lookup(sat_data->objects, path);
+                       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+                       setup_call = sat_manager_setup_call_noti(plugin, &q_data.cmd_data.setup_call);
+
+                       dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
+                       g_variant_get(setup_call, "(isisi@visi)", &command_id, &confirmed_text, &confirmed_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+
+                       telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len, 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);
+                       g_free(tr);
+                       return TRUE;
+               }break;
+
+               case TEL_SAT_USER_CONFIRM_NO_OR_CANCEL:{
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
+                       tr->terminal_rsp_data.setup_call.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.setup_call.cc_problem_type = TEL_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+               }break;
+
+               case TEL_SAT_USER_CONFIRM_END:{
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+               }break;
+
+               case TEL_SAT_USER_CONFIRM_HELP_INFO:
+               default:
+                       tr->terminal_rsp_data.setup_call.result_type = TEL_SAT_RESULT_NO_RESPONSE_FROM_USER;
+               break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+       g_free(tr);
+       return result;
+}
+
+static gboolean _sat_manager_handle_send_dtmf_confirm(TcorePlugin *plugin, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plugin) {
+               err("there is no valid plugin at this point");
+               return result;
+       }
+
+       tr = g_new0(TelSatRequestTerminalResponseData, 1);
+       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(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.send_dtmf.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       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 TEL_SAT_USER_CONFIRM_NO_OR_CANCEL:
+               case TEL_SAT_USER_CONFIRM_END:
+                       tr->terminal_rsp_data.send_dtmf.result_type = TEL_SAT_RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+                       tr->terminal_rsp_data.send_dtmf.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+               default:
+                       tr->terminal_rsp_data.send_dtmf.result_type = TEL_SAT_RESULT_NO_RESPONSE_FROM_USER;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+       g_free(tr);
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_launch_browser_confirm(TcorePlugin *plugin, TcorePlugin *comm_plugin, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (!plugin) {
+               err("there is no valid plugin at this point");
+               return result;
+       }
+
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       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 TEL_SAT_USER_CONFIRM_YES:{
+                       char *path;
+                       TelephonySat *sat;
+                       TelephonyObjectSkeleton *object;
+                       gchar *plg_name = NULL;
+                       GVariant *launch_browser = NULL;
+                       gint command_id = 0;
+                       gint browser_launch_type = 0, 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;
+                       DtapiSatPrivateData *sat_data = NULL;
+
+                       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+                       if (!sat_data) {
+                               err("sat_data is null");
+                               return result;
+                       }
+
+                       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plugin);
+                       if (plg_name) {
+                               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
+                       } else {
+                               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
+                       }
+                       dbg("path = [%s]", path);
+
+                       object = g_hash_table_lookup(sat_data->objects, path);
+                       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+                       launch_browser = sat_manager_launch_browser_noti(plugin, &q_data.cmd_data.launch_browser);
+
+                       dbg("launch_browser type_format(%s)", g_variant_get_type_string(launch_browser));
+                       g_variant_get(launch_browser, "(iiisisisi@v)", &command_id, &browser_launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
+
+                       telephony_sat_emit_launch_browser(sat, command_id, browser_launch_type, 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);
+
+                       g_free(path);
+                       g_free(tr);
+
+                       return TRUE;
+               }break;
+
+               case TEL_SAT_USER_CONFIRM_NO_OR_CANCEL:
+               case TEL_SAT_USER_CONFIRM_END:
+                       tr->terminal_rsp_data.launch_browser.result_type = TEL_SAT_RESULT_BACKWARD_MOVE_BY_USER;
+                       tr->terminal_rsp_data.launch_browser.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+                       tr->terminal_rsp_data.launch_browser.browser_problem_type = TEL_SAT_BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
+                       break;
+
+               default:
+                       tr->terminal_rsp_data.launch_browser.result_type = TEL_SAT_RESULT_NO_RESPONSE_FROM_USER;
+                       break;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+       g_free(tr);
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_open_channel_confirm(TcorePlugin *plugin, TcorePlugin *comm_plugin, gint command_id, gint confirm_type, GVariant *addtional_data)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       DtapiSatPrivateData *sat_data = NULL;
+       gboolean result = FALSE;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+       if (!sat_data) {
+               err("sat_data is null");
+               return result;
+       }
+
+       tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+       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(TelSatCmdDetailInfo));
+       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 TEL_SAT_USER_CONFIRM_YES:{
+                       char *path;
+                       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 = (gchar *)tcore_server_get_cp_name_by_plugin(plugin);
+                       if (plg_name) {
+                               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
+                       } else {
+                               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
+                       }
+                       dbg("path = [%s]", path);
+
+                       object = g_hash_table_lookup(sat_data->objects, path);
+
+                       open_channel = sat_manager_open_channel_noti(plugin, &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);*/
+
+                       //BIP Manager
+                       {
+                               gboolean is_sig = FALSE;
+                               GDBusConnection *conn = NULL;
+                               const gchar *g_path = NULL;
+
+                               conn = g_dbus_object_manager_server_get_connection(sat_data->manager);
+                               g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+                               is_sig = sat_ui_support_exec_bip(conn, g_path, TEL_SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
+                       }
+
+                       g_free(path);
+                       g_free(tr);
+
+                       return TRUE;
+               }break;
+
+               case TEL_SAT_USER_CONFIRM_NO_OR_CANCEL:
+               case TEL_SAT_USER_CONFIRM_END:
+                       tr->terminal_rsp_data.open_channel.result_type = TEL_SAT_RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
+                       break;
+               default:
+                       tr->terminal_rsp_data.open_channel.result_type = TEL_SAT_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(TelSatBearerDescriptionInfo));
+       memcpy((void*)&tr->terminal_rsp_data.open_channel.buffer_size, &q_data.cmd_data.open_channel.buffer_size, (2*sizeof(guchar)));
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+       g_free(tr);
+
+       return result;
+}
+
+gboolean sat_manager_handle_user_confirm(DtapiSatPluginsInfo *plugins_info, GVariant *user_confirm_data)
+{
+       gboolean rv = FALSE;
+       gboolean result = FALSE;
+       SatManagerQueueData q_data;
+       TcorePlugin *plugin = NULL;
+       TcorePlugin *comm_plugin = NULL;
+
+       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(&q_data, command_id);
+       if (!rv) {
+               err("[SAT] no commands in queue");
+               return result;
+       }
+
+       command_type = (gint)q_data.cmd_type;
+       dbg("[SAT] command type(%d)", command_type);
+
+       plugin = plugins_info->plugin;
+       comm_plugin = plugins_info->comm_plugin;
+
+       switch (command_type) {
+               case TEL_SAT_PROATV_CMD_SELECT_ITEM:
+                       result = _sat_manager_handle_menu_select_confirm(plugin, command_id, confirm_type, additional_data);
+                       break;
+               case TEL_SAT_PROATV_CMD_DISPLAY_TEXT:
+                       result = _sat_manager_handle_display_text_confirm(plugin, command_id, confirm_type, additional_data);
+                       break;
+               case TEL_SAT_PROATV_CMD_GET_INKEY:
+                       result = _sat_manager_handle_get_inkey_confirm(plugin, command_id, confirm_type, additional_data);
+                       break;
+               case TEL_SAT_PROATV_CMD_GET_INPUT:
+                       result = _sat_manager_handle_get_input_confirm(plugin, command_id, confirm_type, additional_data);
+                       break;
+               case TEL_SAT_PROATV_CMD_SETUP_CALL:
+                       result = _sat_manager_handle_setup_call_confirm(plugin, comm_plugin,command_id, confirm_type, additional_data);
+                       break;
+               case TEL_SAT_PROATV_CMD_SEND_DTMF:
+                       result = _sat_manager_handle_send_dtmf_confirm(plugin, command_id, confirm_type, additional_data);
+                       break;
+               case TEL_SAT_PROATV_CMD_LAUNCH_BROWSER:
+                       result = _sat_manager_handle_launch_browser_confirm(plugin, comm_plugin, command_id, confirm_type, additional_data);
+                       break;
+               case TEL_SAT_PROATV_CMD_OPEN_CHANNEL:
+                       result = _sat_manager_handle_open_channel_confirm(plugin, comm_plugin, command_id, confirm_type, additional_data);
+                       break;
+               default:
+                       err("[SAT] cannot handle user confirm command(0x%x)", command_type);
+                       break;
+       }
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_play_tone_ui_display_status(TelephonySat *sat, TcorePlugin *plugin, SatManagerQueueData *q_data, gboolean display_status)
+{
+       GVariant *play_tone = NULL;
+       gint command_id, tone_type, duration;
+       gint text_len;
+       gchar* text;
+       GVariant *icon_id;
+
+       if (!display_status) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               err("[SAT] fail to show ui display for play tone");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+
+               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(TelSatCmdDetailInfo));
+
+               tr->terminal_rsp_data.play_tone.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               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 = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return TRUE;
+       }
+
+       //emit play tone signal
+       play_tone = sat_manager_play_tone_noti(plugin, &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(TelephonySat *sat, TcorePlugin *plugin,SatManagerQueueData *q_data, gboolean display_status)
+{
+       GVariant *send_sms = NULL;
+       gint command_id, ton, npi, tpdu_type;
+       gboolean is_packing_required;
+       gint text_len, number_len, tpdu_data_len;
+       gchar* text, *dialling_number;
+       GVariant *tpdu_data, *icon_id;
+
+       if (!display_status) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               err("[SAT] fail to show ui display for send sms");
+
+               tr = g_new0(TelSatRequestTerminalResponseData, 1);
+
+               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(TelSatCmdDetailInfo));
+
+               tr->terminal_rsp_data.send_sms.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               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 = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+               return TRUE;
+       }
+
+       //emit send sms signal
+       send_sms = sat_manager_send_sms_noti(plugin, &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, &is_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, is_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(TelephonySat *sat, TcorePlugin *plugin,SatManagerQueueData *q_data, gboolean display_status)
+{
+       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) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               err("[SAT] fail to show ui display for send ss");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+
+               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(TelSatCmdDetailInfo));
+
+               tr->terminal_rsp_data.send_ss.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               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 = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return TRUE;
+       }
+
+       //emit send ss signal
+       send_ss = sat_manager_send_ss_noti(plugin, &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);
+       sat_ui_support_launch_ciss_application(TEL_SAT_PROATV_CMD_SEND_SS, send_ss);
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_send_ussd_ui_display_status(TelephonySat *sat, TcorePlugin *plugin,SatManagerQueueData *q_data, gboolean display_status)
+{
+       GVariant *send_ussd = NULL;
+       gint command_id;
+       gint text_len, ussd_str_len;
+       gchar* text, *ussd_string;
+       GVariant *icon_id;
+
+       if (!display_status) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               err("[SAT] fail to show ui display for send ussd");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+
+               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(TelSatCmdDetailInfo));
+
+               tr->terminal_rsp_data.send_ussd.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               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 = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return TRUE;
+       }
+
+       /* emit send ussd signal */
+       send_ussd = sat_manager_send_ussd_noti(plugin, &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);
+       sat_ui_support_launch_ciss_application(TEL_SAT_PROATV_CMD_SEND_USSD, send_ussd);
+
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_setup_idle_mode_text_ui_display_status(TcorePlugin *plugin,SatManagerQueueData *q_data, gboolean display_status)
+{
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       TelSatRequestTerminalResponseData *tr;
+
+       if (!plugin) {
+               err("there is no valid plugin at this point");
+               return result;
+       }
+
+       tr = g_new0(TelSatRequestTerminalResponseData, 1);
+       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(TelSatCmdDetailInfo));
+       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 = TEL_SAT_RESULT_SUCCESS_RETURN;
+               if (q_data->cmd_data.idle_mode.icon_id.icon_info.ics == TEL_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR)
+                               tr->terminal_rsp_data.setup_idle_mode_text.result_type = TEL_SAT_RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+       //fail to display text
+       if (!display_status) {
+               err("[SAT] fail to show ui display for setup_idle_mode_text");
+               tr->terminal_rsp_data.setup_idle_mode_text.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+       g_free(tr);
+
+       sat_ui_support_terminate_sat_ui();
+
+       return result;
+}
+
+static gboolean _sat_manager_handle_refresh_ui_display_status(TcorePlugin *plugin,SatManagerQueueData *q_data, gboolean display_status)
+{
+       TelSatRequestTerminalResponseData tr;
+
+       memset(&tr, 0, sizeof(TelSatRequestTerminalResponseData));
+
+       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(TelSatCmdDetailInfo));
+       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;
+
+       if (!display_status) {
+               err("fail to show ui for refresh");
+               tr.terminal_rsp_data.refresh.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+       }
+       else{
+               dbg("success to show ui for refresh");
+               tr.terminal_rsp_data.more_time.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+               tr.terminal_rsp_data.more_time.me_problem_type = TEL_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+       }
+
+       dbg("send refresh tr");
+       sat_manager_send_terminal_response(plugin, &tr);
+       return TRUE;
+}
+
+static gboolean _sat_manager_handle_send_dtmf_ui_display_status(TelephonySat *sat, TcorePlugin *plugin,SatManagerQueueData *q_data, gboolean display_status)
+{
+       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) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               err("[SAT] fail to show ui display for send_dtmf");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+
+               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(TelSatCmdDetailInfo));
+
+               tr->terminal_rsp_data.send_dtmf.device_id.src = TEL_SAT_DEVICE_ID_ME;
+               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 = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return TRUE;
+       }
+
+       //emit send_dtmf signal
+       send_dtmf = sat_manager_send_dtmf_noti(plugin, &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_len, &dtmf_str);
+
+       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(TcorePlugin *plugin, TcorePlugin *comm_plugin, SatManagerQueueData *q_data, gboolean display_status)
+{
+       char *path;
+       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;
+       DtapiSatPrivateData *sat_data = NULL;
+
+       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+       if (!sat_data) {
+               err("sat_data is null");
+               return FALSE;
+       }
+
+       if (!display_status) {
+               TelSatRequestTerminalResponseData *tr = NULL;
+               err("[SAT] fail to show ui display for open channel");
+
+               tr = (TelSatRequestTerminalResponseData *)calloc(1, sizeof(TelSatRequestTerminalResponseData));
+
+               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(TelSatCmdDetailInfo));
+
+               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 = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+
+               sat_manager_send_terminal_response(plugin, tr);
+               g_free(tr);
+
+               return TRUE;
+       }
+
+       //emit send_dtmf signal
+       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plugin);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
+       } else {
+               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(sat_data->objects, path);
+
+       open_channel = sat_manager_open_channel_noti(plugin, &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);*/
+
+       //BIP Manager
+       {
+               gboolean is_sig = FALSE;
+               GDBusConnection *conn = NULL;
+               const gchar *g_path = NULL;
+
+               conn = g_dbus_object_manager_server_get_connection(sat_data->manager);
+               g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+               is_sig = sat_ui_support_exec_bip(conn, g_path, TEL_SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
+       }
+
+       return TRUE;
+}
+
+gboolean sat_manager_handle_ui_display_status(DtapiSatPluginsInfo *plugins_info, gint command_id, gboolean display_status)
+{
+       char *path;
+       gchar *plg_name = NULL;
+       gboolean result = FALSE;
+       TelephonySat *sat;
+       DtapiSatPrivateData *sat_data = NULL;
+       TelephonyObjectSkeleton *object;
+       SatManagerQueueData q_data;
+       TcorePlugin *plugin = NULL;
+       TcorePlugin *comm_plugin = NULL;
+
+       dbg("[SAT] ui display status : command id(%d) display status(%d)", command_id, display_status);
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       plugin = plugins_info->plugin;
+       comm_plugin = plugins_info->comm_plugin;
+
+       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+       if (!sat_data) {
+               err("sat_data is null");
+               return FALSE;
+       }
+
+       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plugin);
+       if (plg_name) {
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
+       }
+       else {
+               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
+       }
+       dbg("path = [%s]", path);
+
+       object = g_hash_table_lookup(sat_data->objects, path);
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command peek data from queue is failed. didn't find in command Q!!");
+               return result;
+       }
+
+       switch (q_data.cmd_type) {
+               case TEL_SAT_PROATV_CMD_PLAY_TONE:
+                       result = _sat_manager_handle_play_tone_ui_display_status(sat, plugin, &q_data, display_status);
+                       break;
+               case TEL_SAT_PROATV_CMD_SEND_SMS:
+                       result = _sat_manager_handle_send_sms_ui_display_status(sat, plugin, &q_data, display_status);
+                       break;
+               case TEL_SAT_PROATV_CMD_SEND_SS:
+                       result = _sat_manager_handle_send_ss_ui_display_status(sat, plugin, &q_data, display_status);
+                       break;
+               case TEL_SAT_PROATV_CMD_SEND_USSD:
+                       result = _sat_manager_handle_send_ussd_ui_display_status(sat, plugin, &q_data, display_status);
+                       break;
+               case TEL_SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+                       result = _sat_manager_handle_setup_idle_mode_text_ui_display_status(plugin, &q_data, display_status);
+                       break;
+               case TEL_SAT_PROATV_CMD_REFRESH:
+                       result = _sat_manager_handle_refresh_ui_display_status(plugin, &q_data, display_status);
+                       break;
+               case TEL_SAT_PROATV_CMD_SEND_DTMF:
+                       result = _sat_manager_handle_send_dtmf_ui_display_status(sat, plugin, &q_data, display_status);
+                       break;
+               case TEL_SAT_PROATV_CMD_OPEN_CHANNEL:
+                       result = _sat_manager_handle_open_channel_ui_display_status(plugin, comm_plugin, &q_data, display_status);
+                       break;
+               default:
+                       err("[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, TelSatEnvelopEventDownloadTlv *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 TEL_SAT_EVENT_USER_ACTIVITY:
+                       dbg("data type_format(%s)", g_variant_get_type_string(data));
+                       evt_download->device_identitie.src = src_dev;
+                       evt_download->device_identitie.dest = dest_dev;
+                       break;
+               case TEL_SAT_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 = TEL_SAT_DEVICE_ID_DISPLAY;
+                       evt_download->device_identitie.dest = dest_dev;
+                       dbg("idle screen available (%d)", evt_download->idle_screen);
+                       break;
+               case TEL_SAT_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 TEL_SAT_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 TEL_SAT_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 = channel_data_len;
+                       dbg("data available channel id (%d)", evt_download->channel_status.channel_id);
+               } break;
+               case TEL_SAT_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 :
+                       err("not support download event (%d)", event_type);
+                       break;
+       }
+
+       return TRUE;
+}
+
+gboolean sat_manager_update_language(TcorePlugin *plugin, TcorePlugin *comm_plugin, GVariant *language_noti)
+{
+       DtapiSatPrivateData *sat_data;
+       static TcoreStorage *strg;
+       TelReturn rv = TEL_RETURN_FAILURE;
+       gboolean result = FALSE;
+       const gchar *lang_str = NULL;
+       gint command_id, language;
+       gboolean is_specified;
+       TelSatRequestTerminalResponseData *tr;
+       SatManagerQueueData q_data;
+
+       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+       if (!sat_data) {
+               err("sat_data is null");
+               return result;
+       }
+
+       strg = tcore_server_find_storage(sat_data->server, "vconf");
+
+       memset(&q_data, 0, sizeof(SatManagerQueueData));
+
+       dbg("language_noti type_format(%s)", g_variant_get_type_string(language_noti));
+       g_variant_get(language_noti, "(iib)", &command_id, &language, &is_specified);
+
+       if (sat_manager_dequeue_cmd_by_id(&q_data, command_id) == FALSE) {
+               err("[SAT] command dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       if (q_data.cmd_type != TEL_SAT_PROATV_CMD_LANGUAGE_NOTIFICATION) {
+               err("[SAT] Language Noti dequeue failed. didn't find in command Q!!");
+               return result;
+       }
+
+       tr = g_new0(TelSatRequestTerminalResponseData, 1);
+       tr->cmd_number = q_data.cmd_data.language_notification.command_detail.cmd_num;
+       tr->cmd_type = q_data.cmd_data.language_notification.command_detail.cmd_type;
+       memcpy((void*)&tr->terminal_rsp_data.language_notification.command_detail, &q_data.cmd_data.language_notification.command_detail, sizeof(TelSatCmdDetailInfo));
+       tr->terminal_rsp_data.language_notification.device_id.src = TEL_SAT_DEVICE_ID_ME;
+       tr->terminal_rsp_data.language_notification.device_id.dest = TEL_SAT_DEVICE_ID_SIM;
+       tr->terminal_rsp_data.language_notification.result_type = TEL_SAT_RESULT_SUCCESS_RETURN;
+
+       lang_str = _convert_sim_lang_to_string((TelSimLanguagePreferenceCode)language);
+       if (!lang_str) {
+               dbg("language is not exist");
+               tr->terminal_rsp_data.language_notification.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+       }
+       dbg("converted lang (%s)", lang_str);
+
+       result = tcore_storage_set_string(strg, STORAGE_KEY_LANGUAGE_SET, (const char*)lang_str);
+       if (!result) {
+               dbg("fail to update language");
+               tr->terminal_rsp_data.language_notification.result_type = TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+       }
+
+       result = TRUE;
+       rv = sat_manager_send_terminal_response(plugin, tr);
+       if (rv != TEL_RETURN_SUCCESS) {
+               err("fail to send terminal response");
+               result = FALSE;
+       }
+
+       g_free(tr);
+       return result;
+}
+
+void sat_manager_init(TcorePlugin *plugin, GHashTable *objects, Server *server, GDBusObjectManagerServer *manager) {
+       DtapiSatPrivateData *sat_data;
+
+       dbg("Entry");
+
+       sat_data = calloc(1, sizeof(DtapiSatPrivateData));
+       if (!sat_data) {
+               err("failed to allocate memory");
+               return;
+       }
+
+       sat_data->server = server;
+       sat_data->cached_data = NULL;
+       sat_data->objects = objects;
+       sat_data->manager = manager;
+
+       if (tcore_plugin_link_user_data(plugin, sat_data) != TEL_RETURN_SUCCESS) {
+               err("Failed to link plugin private data");
+               free(sat_data);
+               return;
+       }
+}
+
+void sat_manager_deinit(TcorePlugin *plugin) {
+       DtapiSatPrivateData *sat_data;
+
+       dbg("Entry");
+
+       sat_data = tcore_plugin_ref_user_data(plugin);
+
+       tcore_free(sat_data);
+}
diff --git a/sat-manager/src/sat_ui_support.c b/sat-manager/src/sat_ui_support.c
new file mode 100644 (file)
index 0000000..713efde
--- /dev/null
@@ -0,0 +1,1004 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 <unistd.h>
+#include <sys/types.h>
+#include <sys/xattr.h>
+#include <errno.h>
+#include <aul.h>
+#include <appsvc.h>
+#include <bundle.h>
+
+#include "sat_ui_support.h"
+
+#define SAT_UI_APP "org.tizen.sat-ui"
+#define DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data) \
+       do { \
+               bundle *bundle_data = 0; \
+               gint rv; \
+               \
+               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(SAT_UI_APP, bundle_data); \
+               dbg("aul launch app rv: (%d)", rv); \
+               bundle_free(bundle_data); \
+       } while (0)
+
+static TcoreStorage *strg_vconf = NULL;
+#if 0
+static gboolean _sat_ui_support_processing_setup_menu_ind(GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatSetupMenuInfo setup_menu;
+       gchar *title;
+       gint command_id, item_cnt;
+       gboolean is_present, is_helpinfo, is_updated;
+       GVariant *items = NULL, *icon_id, *icon_list;
+
+       memset(&setup_menu, 0, sizeof(TelSatSetupMenuInfo));
+
+       g_variant_get(data, "(ibs@vibb@v@v)", &command_id, &is_present, &title, &items, &item_cnt,
+                               &is_helpinfo, &is_updated, &icon_id, &icon_list);
+
+       setup_menu.command_id = command_id;
+       setup_menu.is_main_menu_present = (is_present ? 1 : 0);
+       memcpy(setup_menu.sat_main_title, title, TEL_SAT_DEF_TITLE_LEN_MAX+1);
+       setup_menu.sat_main_menu_item_count = 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.sat_main_menu_item[index].item_id = item_id;
+                       memcpy(setup_menu.sat_main_menu_item[index].item_string, item_str, TEL_SAT_DEF_ITEM_STR_LEN_MAX + 6);
+                       index++;
+               }
+               g_variant_iter_free(iter);
+       }
+       setup_menu.is_sat_main_menu_help_info = (is_helpinfo ? 1 : 0);
+       setup_menu.is_updated_sat_main_menu = (is_updated ? 1 : 0);
+
+       cmd_type = g_strdup_printf("%d", TEL_SAT_PROATV_CMD_SETUP_MENU);
+       encoded_data = g_base64_encode((const guchar*)&setup_menu, sizeof(TelSatSetupMenuInfo));
+
+       dbg("launching SAT APP for setup menu ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+#endif
+static gboolean _sat_ui_support_processing_display_text_ind(GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatDisplayTextInd 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));
+
+       g_variant_get(data, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
+               &high_priority, &user_rsp_required, &immediately_rsp, &icon_id);
+
+       display_text.command_id = command_id;
+       memcpy(display_text.text.string, text, TEL_SAT_TEXT_STRING_LEN_MAX+1);
+       display_text.text.string_len = text_len;
+       display_text.duration = duration;
+       display_text.is_priority_high = (high_priority ? 1 : 0);
+       display_text.is_user_resp_required = (user_rsp_required ? 1 : 0);
+       display_text.immediately_resp = (immediately_rsp ? 1 : 0);
+       dbg("duration(%d) user_rsp(%d) immediately_rsp(%d)", duration, user_rsp_required, immediately_rsp);
+
+       cmd_type = g_strdup_printf("%d", TEL_SAT_PROATV_CMD_DISPLAY_TEXT);
+       encoded_data = g_base64_encode((const guchar*)&display_text, sizeof(TelSatDisplayTextInd));
+
+       dbg("launching SAT APP for display text ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_select_item_ind(GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatSelectItemInd 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));
+
+       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.command_id = command_id;
+       select_item.is_help_info_available = (help_info ? 1 : 0);
+       memcpy(select_item.text.string, selected_text, TEL_SAT_DEF_TITLE_LEN_MAX+1);
+       select_item.text.string_len = text_len;
+       select_item.default_item_index = default_item_id;
+       select_item.menu_item_count = 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.menu_item[index].item_id = item_id;
+                       select_item.menu_item[index].text_len = item_len;
+                       memcpy(select_item.menu_item[index].text, item_str, TEL_SAT_ITEM_TEXT_LEN_MAX + 1);
+                       index++;
+               }
+               g_variant_iter_free(iter);
+       }
+
+       cmd_type = g_strdup_printf("%d", TEL_SAT_PROATV_CMD_SELECT_ITEM);
+       encoded_data = g_base64_encode((const guchar*)&select_item, sizeof(TelSatSelectItemInd));
+
+       dbg("launching SAT APP for select item ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_get_inkey_ind(GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatGetInkeyInd get_inkey;
+       gint command_id, key_type, input_character_mode;
+       gint text_len, duration;
+       gboolean is_numeric, is_help_info;
+       gchar *text;
+       GVariant *icon_id;
+
+       memset(&get_inkey, 0, sizeof(TelSatGetInkeyInd));
+
+       g_variant_get(data, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
+               &is_numeric,&is_help_info, &text, &text_len, &duration, &icon_id);
+
+       get_inkey.command_id = command_id;
+       get_inkey.key_type = key_type;
+       get_inkey.input_char_mode = input_character_mode;
+       get_inkey.is_numeric = (is_numeric ? 1 : 0);
+       get_inkey.is_help_info_available = (is_help_info ? 1 : 0);
+       memcpy(get_inkey.text.string, text, TEL_SAT_TEXT_STRING_LEN_MAX+1);
+       get_inkey.text.string_len = text_len;
+       get_inkey.duration = duration;
+
+       cmd_type = g_strdup_printf("%d", TEL_SAT_PROATV_CMD_GET_INKEY);
+       encoded_data = g_base64_encode((const guchar*)&get_inkey, sizeof(TelSatGetInkeyInd));
+
+       dbg("launching SAT APP for get inkey ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_get_input_ind(GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatGetInputInd get_input;
+       gint command_id, input_character_mode;
+       gint text_len, def_text_len, rsp_len_min, rsp_len_max;
+       gboolean is_numeric, is_help_info, is_echo_input;
+       gchar *text, *def_text;
+       GVariant *icon_id;
+
+       memset(&get_input, 0, sizeof(TelSatGetInputInd));
+
+       g_variant_get(data, "(iibbbsiiisi@v)", &command_id, &input_character_mode, &is_numeric, &is_help_info, &is_echo_input,
+               &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len, &icon_id);
+
+       get_input.command_id = command_id;
+       get_input.input_char_mode = input_character_mode;
+       get_input.is_numeric = (is_numeric ? 1 : 0);
+       get_input.is_help_info_available = (is_help_info ? 1 : 0);
+       get_input.is_echo_input = (is_echo_input ? 1 : 0);
+       memcpy(get_input.text.string, text, TEL_SAT_TEXT_STRING_LEN_MAX+1);
+       get_input.text.string_len = text_len;
+       get_input.resp_len.max = rsp_len_max;
+       get_input.resp_len.min = rsp_len_min;
+       memcpy(get_input.default_text.string, def_text, TEL_SAT_TEXT_STRING_LEN_MAX+1);
+       get_input.default_text.string_len = def_text_len;
+
+       cmd_type = g_strdup_printf("%d", TEL_SAT_PROATV_CMD_GET_INPUT);
+       encoded_data = g_base64_encode((const guchar*)&get_input, sizeof(TelSatGetInputInd));
+
+       dbg("launching SAT APP for get input ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_refresh_ind(GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatRefreshIndUiInfo refresh_info;
+       gint command_id = 0;
+       gint refresh_type =0;
+       GVariant *file_list = NULL;
+
+       memset(&refresh_info, 0, sizeof(TelSatRefreshIndUiInfo));
+
+       dbg("refresh type_format(%s)", g_variant_get_type_string(data));
+       g_variant_get(data, "(ii@v)", &command_id, &refresh_type, &file_list);
+
+       refresh_info.command_id = command_id;
+       refresh_info.duration = 10000;
+       refresh_info.refresh_type = refresh_type;
+
+       cmd_type = g_strdup_printf("%d", TEL_SAT_PROATV_CMD_REFRESH);
+       encoded_data = g_base64_encode((const guchar*)&refresh_info, sizeof(TelSatRefreshIndUiInfo));
+
+       dbg("launching SAT APP for get input ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_play_tone_ind(GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatPlayToneInd play_tone_info;
+       gint command_id, tone_type, duration;
+       gint text_len;
+       gchar* text;
+       GVariant *icon_id;
+
+       memset(&play_tone_info, 0, sizeof(TelSatPlayToneInd));
+
+       g_variant_get(data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
+
+       play_tone_info.command_id = command_id;
+       play_tone_info.duration = duration;
+       play_tone_info.text.string_len = text_len;
+       memcpy(play_tone_info.text.string, text, TEL_SAT_TEXT_STRING_LEN_MAX+1);
+       play_tone_info.tone = tone_type;
+
+       cmd_type = g_strdup_printf("%d", TEL_SAT_PROATV_CMD_PLAY_TONE);
+       encoded_data = g_base64_encode((const guchar*)&play_tone_info, sizeof(TelSatPlayToneInd));
+
+       dbg("launching SAT APP for play tone ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_idle_mode_text_ind(GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatSetupIdleModeTextInd idle_mode_text_info;
+       gint command_id, text_len;
+       gchar* text;
+       GVariant *icon_id;
+
+       memset(&idle_mode_text_info, 0, sizeof(TelSatSetupIdleModeTextInd));
+
+       g_variant_get(data, "(isi@v)", &command_id, &text, &text_len, &icon_id);
+
+       idle_mode_text_info.command_id = command_id;
+       idle_mode_text_info.text.string_len = text_len;
+       memcpy(idle_mode_text_info.text.string, text, TEL_SAT_TEXT_STRING_LEN_MAX+1);
+
+       cmd_type = g_strdup_printf("%d", TEL_SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT);
+       encoded_data = g_base64_encode((const guchar*)&idle_mode_text_info, sizeof(TelSatSetupIdleModeTextInd));
+
+       dbg("launching SAT APP for setup idle mode text ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_processing_ui_info_ind(TelSatProactiveCmdType cmd, GVariant *data)
+{
+       gchar *encoded_data = NULL, *cmd_type = NULL;
+       TelSatSendUiInfo ui_info;
+       gint command_id, text_len;
+       gboolean user_confirm;
+       gchar *text;
+
+       memset(&ui_info, 0, sizeof(TelSatSendUiInfo));
+
+       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.command_id = command_id;
+       memcpy(ui_info.text.string, text, TEL_SAT_TEXT_STRING_LEN_MAX+1);
+       ui_info.text.string_len = 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));
+
+       dbg("launching SAT APP for ui info ind");
+       DBUS_LAUNCH_SAT_APP(cmd_type, encoded_data);
+
+       g_free(encoded_data);
+       g_free(cmd_type);
+
+       return TRUE;
+}
+
+static gboolean _sat_ui_support_create_desktop_file(const gchar *title)
+{
+       int rv = 0;
+       int b_check = 0;
+       FILE *f_out;
+
+       if(!title){
+               dbg("title does not exist");
+               return FALSE;
+       }
+
+       b_check = access("/opt/share/applications/org.tizen.sat-ui.desktop", F_OK);
+       if( b_check == 0 && !(g_strcmp0(title,"temp")) ){
+               dbg("desktop file aleady exist");
+               return FALSE;
+       }
+
+       f_out = fopen("/opt/share/applications/org.tizen.sat-ui.desktop", "w");
+       if(!f_out){
+               dbg("fail to create sat-ui desktop file");
+               return FALSE;
+       }
+
+       fprintf(f_out, "Package=org.tizen.sat-ui\n");
+       fprintf(f_out, "Name=%s\n",title);
+       fprintf(f_out, "Type=Application\n");
+       fprintf(f_out, "Version=0.2.2\n");
+
+       if( g_strcmp0(title,"temp") == 0 ){
+               fprintf(f_out, "NoDisplay=true\n");
+       }
+
+       fprintf(f_out, "Exec=/usr/apps/org.tizen.sat-ui/bin/sat-ui KEY_EXEC_TYPE 0\n");
+       fprintf(f_out, "Icon=org.tizen.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);
+       //fflush(f_out);
+
+       //rv = system("/bin/cp /tmp/org.tizen.sat-ui.desktop /opt/share/applications/");
+       //dbg("the result to create desktop file (%d)", rv);
+       //rv = system("/bin/rm /tmp/org.tizen.sat-ui.desktop");
+
+       rv = setxattr("/opt/share/applications/org.tizen.sat-ui.desktop", "security.SMACK64","_",1,0);
+       dbg("the result to apply the smack value(%d)", rv);
+
+       b_check = access("/opt/share/applications/org.tizen.sat-ui.desktop", F_OK);
+       dbg("access result (%d)", b_check);
+
+       if(rv == -1 || rv == 127) {
+               dbg("rv (%d)", rv);
+               return FALSE;
+       }
+
+       //rv = system("/bin/ls -al /opt/share/applications > /opt/var/log/desktop_file_list.txt");
+
+       return TRUE;
+}
+
+static void _sat_ui_support_storage_key_callback(TcoreStorageKey key, void *value, void *user_data)
+{
+       GVariant *tmp = NULL;
+       gboolean type_check = FALSE;
+
+       dbg("storage key(%d) callback", key);
+       tmp = (GVariant *)value;
+       if(!tmp || !strg_vconf){
+               err("value is null");
+               return;
+       }
+
+       if(key == STORAGE_KEY_IDLE_SCREEN_LAUNCHED) {
+               int b_launched = 0;
+               const gchar *title = (const gchar*)user_data;
+               gboolean ret;
+
+               type_check = g_variant_is_of_type(tmp, G_VARIANT_TYPE_INT32);
+               if(!type_check){
+                       dbg("wrong variant data type");
+                       goto EXIT;
+               }
+
+               b_launched = g_variant_get_int32(tmp);
+               if(b_launched < 0) {
+                       dbg("tcore_storage_get_int(VCONFKEY_IDLE_SCREEN_LAUNCHED) failed");
+                       goto EXIT;
+               }
+
+               if(b_launched) {
+                       dbg("idle screen is ready, create desktop file.");
+                       ret = _sat_ui_support_create_desktop_file(title);
+               }
+       }
+       else {
+               dbg("unspported key.");
+       }
+
+EXIT:
+       g_variant_unref(tmp);
+       return;
+}
+
+static gboolean _sat_ui_support_register_key_callback(TcoreStorageKey key, void * user_data)
+{
+       gboolean ret = FALSE;
+
+       if (strg_vconf == NULL) {
+               err("VCONF TcoreStorage is NULL!!!");
+               return ret;
+       }
+
+       dbg("Set key callback - KEY: [%d]", key);
+       ret = tcore_storage_set_key_callback(strg_vconf, key, _sat_ui_support_storage_key_callback, user_data);
+
+       return ret;
+}
+
+gboolean sat_ui_support_terminate_sat_ui()
+{
+       gint rv;
+       bundle *bundle_data = 0;
+       gchar *cmd_type = NULL;
+
+       cmd_type = g_strdup_printf("%d", TEL_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(SAT_UI_APP, 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(TelSatProactiveCmdType cmd_type, GVariant *data)
+{
+       gboolean result = FALSE;
+       sat_ui_support_create_desktop_file("temp");
+
+       switch(cmd_type){
+               case TEL_SAT_PROATV_CMD_NONE:
+               case TEL_SAT_PROATV_CMD_SEND_DTMF:
+                       result = _sat_ui_support_processing_ui_info_ind(cmd_type, data);
+               break;
+               /* No need to launch SAT UI in case of setup menu command */
+               /*case TEL_SAT_PROATV_CMD_SETUP_MENU:
+                       result = _sat_ui_support_processing_setup_menu_ind(data);
+               */
+               break;
+               case TEL_SAT_PROATV_CMD_DISPLAY_TEXT:
+                       result = _sat_ui_support_processing_display_text_ind(data);
+               break;
+               case TEL_SAT_PROATV_CMD_SELECT_ITEM:
+                       result = _sat_ui_support_processing_select_item_ind(data);
+               break;
+               case TEL_SAT_PROATV_CMD_GET_INKEY:
+                       result = _sat_ui_support_processing_get_inkey_ind(data);
+               break;
+               case TEL_SAT_PROATV_CMD_GET_INPUT:
+                       result = _sat_ui_support_processing_get_input_ind(data);
+               break;
+               case TEL_SAT_PROATV_CMD_REFRESH:
+                       result = _sat_ui_support_processing_refresh_ind(data);
+               break;
+               case TEL_SAT_PROATV_CMD_PLAY_TONE:
+                       result = _sat_ui_support_processing_play_tone_ind(data);
+               break;
+               case TEL_SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+                       result = _sat_ui_support_processing_idle_mode_text_ind(data);
+               break;
+               case TEL_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(TelSatProactiveCmdType cmd_type, GVariant *data)
+{
+       //gint rv;
+       char buffer[300];
+       bundle *bundle_data = 0;
+
+       dbg("launch call application by aul");
+       bundle_data = bundle_create();
+
+       appsvc_set_operation(bundle_data, APPSVC_OPERATION_CALL);
+       appsvc_set_uri(bundle_data,"tel:MT");
+
+       switch(cmd_type){
+               case TEL_SAT_PROATV_CMD_SETUP_CALL:{
+                       gint command_id, call_type, confirm_text_len, text_len, duration;
+                       gchar *confirm_text, *text, *call_number;
+                       GVariant *icon_id;
+
+                       dbg("setup call type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isisi@visi)", &command_id, &confirm_text, &confirm_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+
+                       appsvc_add_data(bundle_data, "launch-type","SATSETUPCALL");
+
+                       snprintf(buffer, 300, "%d",command_id);
+                       appsvc_add_data(bundle_data, "cmd_id",buffer);
+                       dbg("cmd_id(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d",call_type);
+                       appsvc_add_data(bundle_data, "cmd_qual", buffer);
+                       dbg("cmd_qual(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", text);
+                       appsvc_add_data(bundle_data, "disp_text", buffer);
+                       dbg("disp_text(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", call_number);
+                       appsvc_add_data(bundle_data, "call_num", buffer);
+                       dbg("call_num(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d", duration);
+                       appsvc_add_data(bundle_data, "dur", buffer);
+                       dbg("dur(%s)",buffer);
+               } break;
+
+               default:
+                       bundle_free(bundle_data);
+                       return FALSE;
+               break;
+       }
+
+       appsvc_run_service(bundle_data, 0, NULL, NULL);
+       dbg("call app is called");
+       //rv = aul_launch_app("com.samsung.call",bundle_data);
+       //dbg("call app aul (%d)", rv);
+       bundle_free(bundle_data);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_launch_browser_application(TelSatProactiveCmdType cmd_type, GVariant *data)
+{
+//     gint rv;
+       char buffer[300];
+       bundle *bundle_data = 0;
+
+       dbg("launch browser application by aul");
+       bundle_data = bundle_create();
+
+       appsvc_set_operation(bundle_data, APPSVC_OPERATION_VIEW);
+
+       switch(cmd_type){
+               case TEL_SAT_PROATV_CMD_LAUNCH_BROWSER:{
+                       gint command_id, launch_type, browser_id;
+                       gint url_len, text_len, gateway_proxy_len;
+                       gchar *url, *text, *gateway_proxy;
+                       GVariant *icon_id = NULL;
+
+                       dbg("launch_browser type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(iiisisisi@v)", &command_id, &launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
+
+                       appsvc_set_uri(bundle_data, url);
+
+                       snprintf(buffer, 300, "%d",command_id);
+                       appsvc_add_data(bundle_data, "cmd_id",buffer);
+                       dbg("cmd_id(%s)",buffer);
+
+                       snprintf(buffer, 300, "%d",launch_type);
+                       appsvc_add_data(bundle_data, "launch_type", buffer);
+                       dbg("launch_type(%s)",buffer);
+
+                       snprintf(buffer, 300, "%s", gateway_proxy);
+                       appsvc_add_data(bundle_data, "proxy", buffer);
+                       dbg("proxy(%s)",buffer);
+
+               } break;
+
+               default:
+                       bundle_free(bundle_data);
+                       return FALSE;
+               break;
+       }
+
+       appsvc_run_service(bundle_data, 0, NULL, NULL);
+       dbg("browser app is called");
+       //rv = aul_launch_app("com.samsung.call",bundle_data);
+       //dbg("call app aul (%d)", rv);
+       bundle_free(bundle_data);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_launch_ciss_application(TelSatProactiveCmdType cmd_type, GVariant *data)
+{
+       bundle *bundle_data = 0;
+       gchar *encoded_data = NULL, *cmd = NULL;
+
+       dbg("launch ciss application by aul");
+       bundle_data = bundle_create();
+
+       appsvc_set_operation(bundle_data, "http://tizen.org/appcontrol/operation/ciss");
+       appsvc_set_pkgname(bundle_data, "com.samsung.ciss");
+
+       switch(cmd_type){
+               case TEL_SAT_PROATV_CMD_SEND_SS:{
+                       TelSatSendSsIndSsData ss_info;
+
+                       gint command_id, ton, npi;
+                       gint text_len, ss_str_len;
+                       gchar* text, *ss_string;
+                       GVariant *icon_id;
+
+                       dbg("launch ciss ui for send ss proactive cmd");
+
+                       memset(&ss_info, 0, sizeof(TelSatSendSsIndSsData));
+
+                       dbg("send ss type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isi@viiis)", &command_id, &text, &text_len, &icon_id, &ton, &npi, &ss_str_len, &ss_string);
+
+                       ss_info.command_id = command_id;
+                       memcpy(ss_info.ss_string, ss_string, TEL_SAT_DEF_SS_LEN_MAX+1);
+                       ss_info.ss_string_len = ss_str_len;
+
+                       cmd = g_strdup_printf("%d", cmd_type);
+                       encoded_data = g_base64_encode((const guchar*)&ss_info, sizeof(TelSatSendSsIndSsData));
+
+               } break;
+
+               case TEL_SAT_PROATV_CMD_SEND_USSD:{
+                       TelSatSendUssdIndUssdData ussd_info;
+
+                       gint command_id;
+                       gint text_len, ussd_str_len;
+                       gchar* text, *ussd_string;
+
+                       GVariant *icon_id;
+
+                       dbg("launch ciss ui for send ussd proactive cmd");
+
+                       memset(&ussd_info, 0, sizeof(TelSatSendUssdIndUssdData));
+
+                       dbg("send ussd type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &ussd_str_len, &ussd_string);
+
+                       ussd_info.command_id = command_id;
+                       memcpy(ussd_info.ussd_string, ussd_string, TEL_SAT_DEF_USSD_LEN_MAX+1);
+                       ussd_info.ussd_string_len = ussd_str_len;
+
+                       cmd = g_strdup_printf("%d", cmd_type);
+                       encoded_data = g_base64_encode((const guchar*)&ussd_info, sizeof(TelSatSendUssdIndUssdData));
+
+               } break;
+
+               default:
+                       bundle_free(bundle_data);
+                       return FALSE;
+               break;
+       }
+
+       appsvc_add_data(bundle_data, "CISS_LAUNCHING_MODE", "RESP");
+       appsvc_add_data(bundle_data, "KEY_EVENT_TYPE", cmd);
+       appsvc_add_data(bundle_data, "KEY_ENCODED_DATA", encoded_data);
+
+       appsvc_run_service(bundle_data, 0, NULL, NULL);
+       dbg("ciss is called");
+       bundle_free(bundle_data);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_launch_setting_application(TelSatProactiveCmdType 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 TEL_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 TEL_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)
+{
+       gboolean ret = FALSE;
+       int is_launched = 0;
+
+       dbg("check vconf if starter is ready.");
+
+       if (strg_vconf == NULL) {
+               err("VCONF TcoreStorage is NULL!!!");
+               return ret;
+       }
+
+       is_launched = tcore_storage_get_int(strg_vconf, STORAGE_KEY_IDLE_SCREEN_LAUNCHED);
+       if(is_launched < 0) {
+               dbg("tcore_storage_get_int(VCONFKEY_IDLE_SCREEN_LAUNCHED) failed");
+               return FALSE;
+       }
+
+       dbg("Launch: [%s]", (is_launched ? "YES" : "NO"));
+       if(is_launched) {
+               dbg("Idle screen is Ready!!! Create Desktop file");
+               ret = _sat_ui_support_create_desktop_file(title);
+               if (ret)
+                       return TRUE;
+       }
+
+       dbg("Idle screen is NOT launched yet!!! Register VCONF notification for Starter ready");
+       ret = _sat_ui_support_register_key_callback(STORAGE_KEY_IDLE_SCREEN_LAUNCHED, (void *)title);
+
+       return ret;
+}
+
+gboolean sat_ui_support_remove_desktop_file(void)
+{
+       int rv = 0;
+       int is_check = 0;
+
+       is_check = access("/opt/share/applications/org.tizen.sat-ui.desktop", F_OK);
+       if(is_check != 0){
+               dbg("desktop file does not exist");
+               return TRUE;
+       }
+
+       rv = system("/bin/rm /opt/share/applications/org.tizen.sat-ui.desktop");
+       dbg("the result to remove desktop file (%d)", rv);
+
+       return TRUE;
+}
+
+gboolean sat_ui_support_exec_bip(GDBusConnection *connection, const gchar *path, TelSatProactiveCmdType cmd_type, GVariant *data)
+{
+       gboolean rv = FALSE;
+       gchar *signal_name = NULL;
+       GVariant *out_param = NULL;
+
+       switch(cmd_type){
+               case TEL_SAT_PROATV_CMD_OPEN_CHANNEL:{
+                       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;
+
+                       dbg("open channel type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data,"(isi@vbbbiviiiisv)", &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);
+
+                       out_param = g_variant_new("(isibbbiviiiisv)", 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);
+                       signal_name = g_strdup("OpenChannel");
+               } break;
+               case TEL_SAT_PROATV_CMD_CLOSE_CHANNEL:{
+                       gint command_id, channel_id, text_len;
+                       gchar *text;
+                       GVariant *icon_id;
+
+                       dbg("close channel type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isi@vi)", &command_id, &text, &text_len, &icon_id, &channel_id);
+
+                       out_param = g_variant_new("(isii)", command_id, text, text_len, channel_id);
+                       signal_name = g_strdup("CloseChannel");
+               } break;
+               case TEL_SAT_PROATV_CMD_RECEIVE_DATA:{
+                       gint command_id, text_len, channel_id, channel_data_len = 0;
+                       gchar *text;
+                       GVariant *icon_id;
+
+                       dbg("receive data type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &channel_id, &channel_data_len);
+
+                       out_param = g_variant_new("(isiii)", command_id, text, text_len, channel_id, channel_data_len);
+                       signal_name = g_strdup("ReceiveData");
+               } break;
+               case TEL_SAT_PROATV_CMD_SEND_DATA:{
+                       gint command_id, channel_id, text_len, channel_data_len;
+                       gboolean send_data_immediately;
+                       gchar *text;
+                       GVariant *channel_data;
+                       GVariant *icon_id;
+
+                       dbg("send data type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(isi@vibvi)", &command_id, &text, &text_len, &icon_id, &channel_id, &send_data_immediately, &channel_data, &channel_data_len);
+
+                       out_param = g_variant_new("(isiibvi)", command_id, text, text_len, channel_id, send_data_immediately, channel_data, channel_data_len);
+                       signal_name = g_strdup("SendData");
+               } break;
+               case TEL_SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
+                       gint command_id;
+
+                       dbg("get channel status type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(i)", &command_id);
+
+                       out_param = g_variant_new("(i)", command_id);
+                       signal_name = g_strdup("GetChannelStatus");
+               } break;
+               case TEL_SAT_PROATV_CMD_SETUP_EVENT_LIST:{
+                       gint event_cnt;
+                       GVariant *evt_list;
+
+                       dbg("setup event list type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(iv)", &event_cnt, &evt_list);
+
+                       out_param = g_variant_new("(iv)", event_cnt, evt_list);
+                       signal_name = g_strdup("SetupEventList");
+               } break;
+               default:
+                       dbg("no matched command");
+                       return FALSE;
+               break;
+       }
+
+       dbg("dbus conn(%p), path(%s)", connection, path);
+       rv = g_dbus_connection_emit_signal(connection, "org.tizen.bip-manager", path, "org.tizen.telephony.SAT", signal_name, out_param, NULL);
+
+       dbg("send signal to bip-mananger result (%d)", rv);
+
+       return rv;
+}
+
+gboolean sat_ui_support_exec_evtdw(GDBusConnection *connection, const gchar *path, TelSatProactiveCmdType cmd_type, GVariant *data)
+{
+       gboolean rv = FALSE;
+       gchar *signal_name = NULL;
+       GVariant *out_param = NULL;
+
+       switch(cmd_type){
+               case TEL_SAT_PROATV_CMD_SETUP_EVENT_LIST:{
+                       gint event_cnt;
+                       GVariant *evt_list;
+
+                       dbg("setup event list type_format(%s)", g_variant_get_type_string(data));
+                       g_variant_get(data, "(iv)", &event_cnt, &evt_list);
+
+                       out_param = g_variant_new("(iv)", event_cnt, evt_list);
+                       signal_name = g_strdup("SetupEventList");
+               } break;
+               default:
+                       dbg("no matched command");
+                       return FALSE;
+               break;
+       }
+
+       dbg("dbus conn(%p), path(%s)", connection, path);
+       rv = g_dbus_connection_emit_signal(connection, "org.tizen.sat-event-downloader", path, "org.tizen.telephony.SAT", signal_name, out_param, NULL);
+
+       dbg("send signal to sat-event-downloader result (%d)", rv);
+
+       return rv;
+}
+
+gboolean sat_ui_support_storage_init(Server *server)
+{
+       TcoreStorage *strg = NULL;
+
+       if(strg_vconf) {
+               dbg("vconf storage already exists!!");
+               return TRUE;
+       }
+
+       dbg("create vconf ");
+
+       strg = tcore_server_find_storage(server, "vconf");
+       if(!strg) {
+               dbg("cannot find vconf storage!!");
+               return FALSE;
+       }
+
+       strg_vconf = strg;
+       return TRUE;
+}
+
diff --git a/src/call.c b/src/call.c
deleted file mode 100644 (file)
index 9bb54e9..0000000
+++ /dev/null
@@ -1,1512 +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 <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 <appsvc.h>
-#include <bundle.h>
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <core_object.h>
-#include <co_call.h>
-#include <communicator.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-#define MAX_CALL_STATUS_NUM 7
-
-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, };
-
-       bundle *kb  = 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 );
-
-       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 );
-
-       kb = bundle_create();
-
-       /* AppSvc */
-       appsvc_set_operation(kb, APPSVC_OPERATION_CALL);
-       appsvc_set_uri(kb,"tel:MT");
-
-       appsvc_add_data(kb, "launch-type", "MT");
-       appsvc_add_data(kb, "handle", id);
-       appsvc_add_data(kb, "number", number);
-       appsvc_add_data(kb, "name_mode", cna);
-       appsvc_add_data(kb, "name", name);
-       appsvc_add_data(kb, "clicause", cli);
-       appsvc_add_data(kb, "fwded", forward);
-       appsvc_add_data(kb, "activeline", active_line);
-
-       appsvc_run_service(kb, 0, NULL, NULL);
-       bundle_free(kb);
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.type = call_type;
-
-       if ( call_number )
-               memcpy( req.number, call_number, MAX_CALL_DIAL_NUM_LEN );
-
-       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 ) {
-               telephony_call_complete_dial(call, invocation, ret);
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.id = call_id;
-       req.type = answer_type;
-
-       tcore_user_request_set_data( ur, sizeof( struct treq_call_answer ), &req );
-       tcore_user_request_set_command( ur, TREQ_CALL_ANSWER );
-
-       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
-       if ( ret != TCORE_RETURN_SUCCESS ) {
-               telephony_call_complete_answer(call, invocation, ret, -1 );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.id = call_id;
-       req.type = end_type;
-
-       tcore_user_request_set_data( ur, sizeof( struct treq_call_end ), &req );
-       tcore_user_request_set_command( ur, TREQ_CALL_END );
-
-       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
-       if ( ret != TCORE_RETURN_SUCCESS ) {
-               telephony_call_complete_end(call, invocation, ret, -1, -1 );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       if ( dtmf_string )
-               memcpy( req.digits, dtmf_string, MAX_CALL_DTMF_DIGITS_LEN );
-
-       tcore_user_request_set_data( ur, sizeof( struct treq_call_dtmf ), &req );
-       tcore_user_request_set_command( ur, TREQ_CALL_SEND_DTMF );
-
-       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
-       if ( ret != TCORE_RETURN_SUCCESS ) {
-               telephony_call_complete_dtmf(call, invocation, ret);
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.id = call_id;
-
-       tcore_user_request_set_data( ur, sizeof( struct treq_call_active ), &req );
-       tcore_user_request_set_command( ur, TREQ_CALL_ACTIVE );
-
-       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
-       if ( ret != TCORE_RETURN_SUCCESS ) {
-               telephony_call_complete_active(call, invocation, ret, -1 );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       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 );
-
-       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
-       if ( ret != TCORE_RETURN_SUCCESS ) {
-               telephony_call_complete_hold(call, invocation, ret, -1 );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.id = call_id;
-
-       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 ) {
-               telephony_call_complete_swap(call, invocation, ret, -1 );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_join(call, invocation, ret, -1 );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_split(call, invocation, ret, -1 );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_transfer(call, invocation, ret, -1 );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_deflect(call, invocation, ret );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-static gboolean on_call_get_status(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data )
-{
-       struct custom_data *ctx = user_data;
-       TcorePlugin *plugin = 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;
-       char *cp_name = GET_PLUGIN_NAME(invocation);
-
-       /* OSP access this function already, can't modify this immediately */
-
-       plugin = tcore_server_find_plugin(ctx->server, cp_name);
-       if ( !plugin ) {
-               dbg("[ error ] plugin : 0");
-               return FALSE;
-       }
-
-       o = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
-       if ( !o ) {
-               dbg("no core object call");
-               return FALSE;
-       }
-
-       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 );
-
-       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;
-       }
-       
-       call_status = tcore_call_object_get_status( co );
-       call_multiparty_state = tcore_call_object_get_multiparty_state( co );
-
-
-       telephony_call_complete_get_status(call, invocation, 
-                       call_id, call_number, call_type, call_direction, call_status, call_multiparty_state );
-
-       return TRUE;
-}
-
-static gboolean on_call_get_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;
-       char *cp_name = GET_PLUGIN_NAME(invocation);
-
-       int len, i;
-
-       /* OSP access this function already, can't modify this immediately */
-
-       plugin = tcore_server_find_plugin(ctx->server, cp_name);
-       if ( !plugin ) {
-               dbg("[ error ] plugin : 0");
-               return FALSE;
-       }
-
-       o = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
-       if ( !o )
-               return FALSE;
-
-       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
-       for ( i=0; i<MAX_CALL_STATUS_NUM; i++ ) {
-               list = tcore_call_object_find_by_status( o, i );
-
-               if ( list ) {
-
-                       GSList *tmp = 0;
-                       tmp = list;
-
-                       dbg("[ check ] there is a call on state (0x%x)", i);
-
-                       while ( tmp ) {
-
-                               co = (CallObject*)list->data;
-                               if ( !co ) {
-                                       dbg("[ error ] call object : 0");
-                                       tmp = tmp->next;
-                                       continue;
-                               }
-
-                               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;
-                               }
-
-                               call_status = tcore_call_object_get_status( co );
-                               call_multiparty_state = tcore_call_object_get_multiparty_state( co );
-
-                               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_state", 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);
-
-                               tmp = g_slist_next( tmp );
-                       }
-
-               } else {
-                       dbg("[ check ] there is no call on state (0x%x)", i);
-
-               }
-
-       }
-
-       gv = g_variant_builder_end(&b);
-
-       telephony_call_complete_get_status_all(call, invocation, gv);
-
-       g_variant_unref(gv);
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "w") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.path = sound_path;
-       req.extra_volume_on = extra_volume_on;
-
-       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 );
-
-       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
-       if ( ret != TCORE_RETURN_SUCCESS ) {
-               telephony_call_complete_set_sound_path(call, invocation, ret);
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "r") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.device = sound_device;
-       req.sound = sound_type;
-
-       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 );
-
-       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
-       if ( ret != TCORE_RETURN_SUCCESS ) {
-
-               GVariantBuilder b;
-               GVariant *result = 0;
-
-               g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-               g_variant_builder_add(&b, "{sv}", "err", g_variant_new_int32(ret));
-               g_variant_builder_close(&b);
-               result = g_variant_builder_end(&b);
-
-               telephony_call_complete_get_volume(call, invocation, ret, result );
-
-               g_variant_unref(result);
-
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "w") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.device = sound_device;
-       req.sound = sound_type;
-       req.volume = sound_volume;
-
-       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 ) {
-               telephony_call_complete_set_volume(call, invocation, ret);
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "r") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_get_mute_status(call, invocation, ret, -1);
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-static gboolean on_call_mute(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
-{
-       struct custom_data *ctx = user_data;
-       UserRequest *ur;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_mute(call, invocation, ret);
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-static gboolean on_call_unmute(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
-{
-       struct custom_data *ctx = user_data;
-       UserRequest *ur;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "x") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_unmute(call, invocation, ret);
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-static gboolean on_call_set_sound_recording(TelephonyCall *call, GDBusMethodInvocation *invocation, gint recording_state, gpointer user_data)
-{
-       struct custom_data *ctx = user_data;
-       struct treq_call_sound_set_recording req;
-       UserRequest *ur;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "w") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_set_sound_recording(call, invocation, ret );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "w") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.mode = (gboolean)eq_mode;
-       req.direction = (enum telephony_call_sound_direction)eq_direction;
-       memcpy( (char*)req.parameter, (const char*)eq_parameter, (MAX_CALL_EQ_PARAMETER_SIZE*2) );
-
-       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 ) {
-               telephony_call_complete_set_sound_equalization(call, invocation, ret );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               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;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "w") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               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 ) {
-               telephony_call_complete_set_sound_noise_reduction(call, invocation, ret );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-static gboolean on_call_set_sound_clock_status(TelephonyCall *call, GDBusMethodInvocation *invocation, gboolean clock_status, gpointer user_data)
-{
-       struct custom_data *ctx = user_data;
-       struct treq_call_sound_set_clock_status req;
-       UserRequest *ur;
-       TReturn ret = 0;
-
-       if (check_access_control(invocation, AC_CALL, "w") == FALSE)
-               return FALSE;
-
-       ur = MAKE_UR(ctx, call, invocation);
-       if (ur == NULL) {
-               dbg("[ error ] ur : 0");
-               return FALSE;
-       }
-
-       req.status = clock_status;
-
-       tcore_user_request_set_data( ur, sizeof( struct treq_call_sound_set_clock_status ), &req );
-       tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_CLOCK_STATUS );
-
-       ret = tcore_communicator_dispatch_request( ctx->comm, ur );
-       if ( ret != TCORE_RETURN_SUCCESS ) {
-               telephony_call_complete_set_sound_clock_status(call, invocation, ret );
-               dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-               tcore_user_request_unref(ur);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-
-
-
-gboolean dbus_plugin_setup_call_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
-       TelephonyCall *call;
-
-       call = telephony_call_skeleton_new();
-       telephony_object_skeleton_set_call(object, call);
-       g_object_unref(call);
-
-       dbg("call = %p", 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-status",
-                       G_CALLBACK (on_call_get_status),
-                       ctx);
-
-       g_signal_connect (call,
-                       "handle-get-status-all",
-                       G_CALLBACK (on_call_get_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);
-
-       g_signal_connect (call,
-                       "handle-set-sound-clock-status",
-                       G_CALLBACK (on_call_set_sound_clock_status),
-                       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;
-       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_call = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CALL);
-       if (!co_call)
-               return FALSE;
-
-       switch (command) {
-               case TRESP_CALL_DIAL: {
-                       struct tresp_call_dial *resp = (struct tresp_call_dial*)data;
-
-                       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_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_end *resp = (struct tresp_call_end*)data;
-
-                       dbg("receive TRESP_CALL_END");
-                       dbg("resp->err : [%d]", resp->err);
-                       dbg("resp->id : [%d]", resp->err);
-                       dbg("resp->type : [%d]", resp->type);
-
-                       telephony_call_complete_end(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id, resp->type );
-
-               } break;
-
-               case TRESP_CALL_HOLD: {
-                       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_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_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_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_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_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_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_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, (gint)resp->err);
-               } break;
-
-               case TRESP_CALL_SET_SOUND_VOLUME_LEVEL: {
-                       struct tresp_call_sound_set_volume_level *resp = (struct tresp_call_sound_set_volume_level*)data;
-
-                       dbg("receive TRESP_CALL_SET_SOUND_VOLUME_LEVEL");
-                       dbg("resp->err : [%d]", resp->err);
-
-                       telephony_call_complete_set_volume(dbus_info->interface_object, dbus_info->invocation, (gint)resp->err);
-               } break;
-
-               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;
-
-                       dbg("receive TRESP_CALL_GET_SOUND_VOLUME_LEVEL");
-
-                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
-                       g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
-                       dbg("resp->err : [%d]", resp->err);
-
-                       g_variant_builder_add(&b, "{sv}", "err", g_variant_new_int32(resp->err));
-
-                       if ( !resp->err ) {
-
-                               dbg("resp->record_num : [%d]", resp->record_num);
-
-                               for ( i=0; i<resp->record_num; i++ ) {
-                                       dbg("resp->type : [%d]", resp->record[i].sound);
-                                       dbg("resp->level : [%d]", resp->record[i].volume);
-
-                                       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));
-                               } 
-
-                       }
-
-                       g_variant_builder_close(&b);
-
-                       result = g_variant_builder_end(&b);
-
-                       telephony_call_complete_get_volume(dbus_info->interface_object, dbus_info->invocation, (gint)resp->err, result );
-
-                       g_variant_unref(result);
-
-               } break;
-
-               case TRESP_CALL_MUTE: {
-                       struct tresp_call_mute *resp = (struct tresp_call_mute*)data;
-
-                       dbg("receive TRESP_CALL_MUTE");
-                       dbg("resp->err : [%d]", resp->err);
-
-                       telephony_call_complete_mute(dbus_info->interface_object, dbus_info->invocation, (gint)resp->err);
-               } break;
-
-               case TRESP_CALL_UNMUTE: {
-                       struct tresp_call_unmute *resp = (struct tresp_call_unmute*)data;
-
-                       dbg("receive TRESP_CALL_UNMUTE");
-                       dbg("resp->err : [%d]", resp->err);
-
-                       telephony_call_complete_unmute(dbus_info->interface_object, dbus_info->invocation, (gint)resp->err);
-               } break;
-
-               case TRESP_CALL_GET_MUTE_STATUS: {
-                       struct tresp_call_get_mute_status *resp = (struct tresp_call_get_mute_status*)data;
-
-                       dbg("receive TRESP_CALL_GET_MUTE_STATUS");
-                       dbg("resp->err : [%d]", resp->err);
-                       dbg("resp->status : [%d]", resp->status);
-
-                       telephony_call_complete_get_mute_status(dbus_info->interface_object, dbus_info->invocation, (gint)resp->err, resp->status );
-
-               } break;
-
-               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, (gint)resp->err );
-
-               } break;
-
-               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, (gint)resp->err );
-
-               } break;
-
-               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, (gint)resp->err );
-
-               } break;
-
-               case TRESP_CALL_SET_SOUND_CLOCK_STATUS: {
-                       struct tresp_call_sound_set_clock_status *resp = (struct tresp_call_sound_set_clock_status*)data;
-                       telephony_call_complete_set_sound_clock_status(dbus_info->interface_object, dbus_info->invocation, (gint)resp->err );
-
-               } break;
-
-
-               default:
-                       dbg("not handled command[%d]", command);
-               break;
-
-       }
-
-       return TRUE;
-}
-
-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)
-{
-       TelephonyCall *call;
-
-       if (!object) {
-               dbg("object is 0");
-               return FALSE;
-       }
-
-       call = telephony_object_peek_call(TELEPHONY_OBJECT(object));
-       dbg("call = %p", call);
-
-       switch (command) {
-               case TNOTI_CALL_STATUS_IDLE: {
-                       struct tnoti_call_status_idle *idle = (struct tnoti_call_status_idle*)data;
-
-                       dbg("[ check ] call status : idle");
-
-                       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;
-
-                       dbg("[ check ] call status : dialing");
-                       dbg("[ check ] call type : (%d)", dialing->type);
-                       dbg("[ check ] call id : (%d)", dialing->id);
-
-                       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 );
-                       }
-
-               } 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;
-
-                       dbg("[ check ] call status : active");
-
-                       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 );
-                       }
-
-               } break;
-               case TNOTI_CALL_STATUS_HELD: {
-                       struct tnoti_call_status_held *held = (struct tnoti_call_status_held*)data;
-
-                       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;
-
-                       dbg("[ check ] call status : incoming");
-
-                       if ( incoming->type != CALL_TYPE_VIDEO ) {
-                               dbg("[ check ] this is voice call");
-
-                               telephony_call_emit_voice_call_status_incoming( call, incoming->id );
-
-                               _launch_voice_call( incoming );
-
-                       } else {
-                               dbg("[ check ] this is video call");
-                               telephony_call_emit_video_call_status_incoming( call, incoming->id );
-
-                               _launch_video_call( incoming );
-                       }
-
-               } break;
-
-               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 );
-
-
-               } break;
-
-               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;
-
-               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 );
-
-               } break;
-
-               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_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_SOUND_CLOCK_STATUS: {
-                       struct tnoti_call_sound_clock_status *noti = (struct tnoti_call_sound_clock_status*)data;
-                       telephony_call_emit_call_sound_clock_status( call, noti->status );
-
-               } break;
-
-               default:
-                       dbg("not handled command[%d]", command);
-               break;
-       }
-
-       return TRUE;
-}
-
diff --git a/src/common.h b/src/common.h
deleted file mode 100644 (file)
index 0458de1..0000000
+++ /dev/null
@@ -1,113 +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.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"
-
-#define AC_MANAGER     "telephony_framework::api_manager"
-#define AC_CALL                "telephony_framework::api_call"
-#define AC_GPS         "telephony_framework::api_gps"
-#define AC_MODEM       "telephony_framework::api_modem"
-#define AC_NETWORK     "telephony_framework::api_network"
-#define AC_PHONEBOOK   "telephony_framework::api_phonebook"
-#define AC_SAP         "telephony_framework::api_sap"
-#define AC_SAT         "telephony_framework::api_sat"
-#define AC_SIM         "telephony_framework::api_sim"
-#define AC_SMS         "telephony_framework::api_sms"
-#define AC_SS          "telephony_framework::api_ss"
-
-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;
-};
-
-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 check_access_control(GDBusMethodInvocation *invoc, const char *label, const char *perm);
-
-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);
-
-gboolean dbus_plugin_setup_gps_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_gps_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_gps_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-#endif
diff --git a/src/desc-dbus.c b/src/desc-dbus.c
deleted file mode 100644 (file)
index 20181ac..0000000
+++ /dev/null
@@ -1,538 +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 <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_network.h>
-#include <co_sim.h>
-#include <co_ps.h>
-
-#ifndef PLUGIN_VERSION
-#define PLUGIN_VERSION 1
-#endif
-
-#include "generated-code.h"
-#include "common.h"
-
-static void set_telephony_ready(Server *server)
-{
-       static Storage *strg;
-       gboolean rv;
-
-       strg = tcore_server_find_storage(server, "vconf");
-       rv = tcore_storage_set_bool(strg, STORAGE_KEY_TELEPHONY_READY, TRUE);
-
-       dbg("Set Telephony Ready (TRUE) to registry - %s", rv ? "SUCCESS"
-                                                               : "FAIL");
-}
-
-static void add_modem(struct custom_data *ctx, TcorePlugin *p)
-{
-       TelephonyObjectSkeleton *object;
-       char *path = NULL;
-       const char *cp_name;
-       dbg("Entry");
-
-       /* Get CP Name */
-       cp_name = tcore_server_get_cp_name_by_plugin(p);
-       if (cp_name == NULL) {
-               err("CP Name is NULL");
-               return;
-       }
-
-       path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
-       dbg("PATH: [%s]", path);
-
-       object = g_hash_table_lookup(ctx->objects, path);
-       if (object == NULL) {
-               /* Create new DBUS Interface object */
-               object = telephony_object_skeleton_new(path);
-
-               /* Insert the Object to DBUS interfaces HASH Table */
-               dbg("New DBUS Interface object created!!! (object = %p)", object);
-               if (object == NULL)
-                       goto OUT;
-
-               g_hash_table_insert(ctx->objects, g_strdup(path), object);
-       } else
-               dbg("DBUS Interface object already created!!! (object = %p)", object);
-
-
-       /* Add DBUS Interfaces for all Modules supported */
-
-       /* MODEM */
-       dbus_plugin_setup_modem_interface(object, ctx);
-
-       /* CALL */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CALL) != NULL)
-               dbus_plugin_setup_call_interface(object, ctx);
-
-       /* NETWORK */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_NETWORK) != NULL)
-               dbus_plugin_setup_network_interface(object, ctx);
-
-       /* SS */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SS) != NULL)
-               dbus_plugin_setup_ss_interface(object, ctx);
-
-       /* SMS */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SMS) != NULL)
-               dbus_plugin_setup_sms_interface(object, ctx);
-
-       /* SIM */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SIM) != NULL)
-               dbus_plugin_setup_sim_interface(object, ctx);
-
-       /* SAT */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAT) != NULL)
-               dbus_plugin_setup_sat_interface(object, ctx);
-
-       /* PHONEBOOK */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_PHONEBOOK) != NULL)
-               dbus_plugin_setup_phonebook_interface(object, ctx);
-
-       /* SAP */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAP) != NULL)
-               dbus_plugin_setup_sap_interface(object, ctx);
-
-       /* GPS */
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_GPS) != NULL)
-               dbus_plugin_setup_gps_interface(object, ctx);
-
-       /* Export the Object to Manager */
-       g_dbus_object_manager_server_export(ctx->manager, G_DBUS_OBJECT_SKELETON(object));
-
-       if (g_dbus_object_manager_server_get_connection (ctx->manager) != NULL)
-               set_telephony_ready(ctx->server);
-
-OUT:
-       /* Freeing memory */
-       g_free(path);
-}
-
-static gboolean refresh_object(gpointer user_data)
-{
-       struct custom_data *ctx = user_data;
-       GSList *plugins;
-       GSList *cur;
-       TcorePlugin *p;
-       CoreObject *co;
-       dbg("Entry");
-
-       if (ctx->manager == NULL) {
-               err("not ready..");
-               return FALSE;
-       }
-
-       plugins = tcore_server_ref_plugins(ctx->server);
-       if (plugins == NULL)
-               return FALSE;
-
-       cur = plugins;
-       for (cur = plugins; cur; cur = cur->next) {
-               p = cur->data;
-               /* AT Standard Plug-in is not considered */
-               if ((p == NULL)
-                               || (strcmp(tcore_plugin_ref_plugin_name(p), "AT") == 0)) {
-                       dbg("Plug-in Name: [%s]", tcore_plugin_ref_plugin_name(p));
-                       continue;
-               }
-
-               co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_MODEM);
-               if (co == NULL)
-                       continue;
-
-               /* Add modem */
-               add_modem(ctx, p);
-       }
-
-       return FALSE;
-}
-
-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;
-
-       dbg("Response Command = [0x%x], data_len = %d", command, data_len);
-
-       ctx = tcore_communicator_ref_user_data(comm);
-       if (ctx == NULL) {
-               dbg("user_data is NULL");
-               return FALSE;
-       }
-
-       ui = tcore_user_request_ref_user_info(ur);
-
-       switch (command & (TCORE_RESPONSE | 0x0FF00000)) {
-               case TRESP_CALL:
-                       dbus_plugin_call_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               case TRESP_SS:
-                       dbus_plugin_ss_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               case TRESP_PS:
-                       break;
-
-               case TRESP_SIM:
-                       dbus_plugin_sim_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               case TRESP_SAP:
-                       dbus_plugin_sap_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               case TRESP_PHONEBOOK:
-                       dbus_plugin_phonebook_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               case TRESP_MODEM:
-                       dbus_plugin_modem_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               case TRESP_SMS:
-                       dbus_plugin_sms_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               case TRESP_SAT:
-                       dbus_plugin_sat_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-               case TRESP_CUSTOM:
-                       break;
-
-               case TRESP_NETWORK:
-                       dbus_plugin_network_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               case TRESP_GPS:
-                       dbus_plugin_gps_response(ctx, ur, ui->user_data, command, data_len, data);
-                       break;
-
-               default:
-                       warn("unknown command (0x%x)", command);
-                       break;
-       }
-
-       return FALSE;
-}
-
-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;
-       TelephonyObjectSkeleton *object;
-       TcorePlugin *p;
-       const char *cp_name;
-       char *path = NULL;
-
-       dbg("Notification!!! (command = 0x%x, data_len = %d)", command, data_len);
-
-       ctx = tcore_communicator_ref_user_data(comm);
-       if (ctx == NULL) {
-               dbg("user_data is NULL");
-               return TCORE_RETURN_FAILURE;
-       }
-
-       /*
-        * Modem binary is not embedded in the platform. Telephony needs to
-        * be set to ready for pwlock. This is temporary solution for
-        * tizen_2.1.
-        * This problem needs to be addressed in pwlock in the future.
-        */
-       if (command == TNOTI_SERVER_MODEM_ERR) {
-               err("Modem interface plugin init failed");
-               set_telephony_ready(ctx->server);
-
-               return TCORE_RETURN_SUCCESS;
-       }
-
-       if (command == TNOTI_SERVER_ADDED_PLUGIN)
-               p = (TcorePlugin *)data;
-       else
-               p = tcore_object_ref_plugin(source);
-
-       cp_name = tcore_server_get_cp_name_by_plugin(p);
-       if (cp_name == NULL)
-               return TCORE_RETURN_FAILURE;
-       dbg("CP Name: [%s]", cp_name);
-
-       if (cp_name) {
-               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
-       }
-       else {
-               path = g_strdup_printf("%s", MY_DBUS_PATH);
-       }
-       dbg("PATH: [%s]", path);
-
-       object = g_hash_table_lookup(ctx->objects, path);
-       dbg("DBUS interface Object = [0x%x]", object);
-
-       switch (command & (TCORE_NOTIFICATION | 0x0FF00000)) {
-               case TNOTI_CALL:
-                       dbus_plugin_call_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_SS:
-                       dbus_plugin_ss_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_PS:
-                       break;
-
-               case TNOTI_SIM:
-                       dbus_plugin_sim_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_SAP:
-                       dbus_plugin_sap_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_PHONEBOOK:
-                       dbus_plugin_phonebook_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_MODEM:
-                       dbus_plugin_modem_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_SMS:
-                       dbus_plugin_sms_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_SAT:
-                       dbus_plugin_sat_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-               case TNOTI_CUSTOM:
-                       break;
-
-               case TNOTI_NETWORK:
-                       dbus_plugin_network_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_GPS:
-                       dbus_plugin_gps_notification(ctx, cp_name, object, command, data_len, data);
-                       break;
-
-               case TNOTI_SERVER:
-                       dbg("Server Notification");
-                       if (command == TNOTI_SERVER_ADDED_PLUGIN) {
-                               dbg("Plug-in is added... Refresh the context");
-                               g_idle_add(refresh_object, ctx);
-                       }
-                       break;
-
-               default:
-                       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 *cp_name_list;
-       gchar **list;
-       const char *name = NULL;
-       int count;
-       dbg("Entry");
-
-       cp_name_list = tcore_server_get_cp_name_list(ctx->server);
-       if (cp_name_list == NULL) {
-               telephony_manager_complete_get_modems(mgr, invocation, &name);
-               return TRUE;
-       }
-
-       count = g_slist_length(cp_name_list);
-       if (count == 0) {
-               err("No Modems present");
-               telephony_manager_complete_get_modems(mgr, invocation, &name);
-               return TRUE;
-       }
-
-       dbg("count: %d", count);
-       list = g_try_malloc0(sizeof(gchar *) * (count+1));
-       if (list == NULL) {
-               err("Failed to allocate memory");
-               g_slist_free_full(cp_name_list, g_free);
-
-               telephony_manager_complete_get_modems(mgr, invocation, &name);
-               return TRUE;
-       }
-
-       count = 0;
-       for ( ; cp_name_list ; cp_name_list = cp_name_list->next) {
-               name = cp_name_list->data;
-               if (name == NULL)
-                       continue;
-
-               list[count] = g_strdup(name);
-               dbg("list[%d]: %s", count, list[count]);
-               count++;
-       }
-
-       telephony_manager_complete_get_modems(mgr, invocation, (const gchar **)list);
-
-       /* Free memory */
-       for (;count >= 0; count--)
-               g_free(list[count]);
-
-       g_free(list);
-
-       /* Freeing the received list of CP names */
-       g_slist_free_full(cp_name_list, g_free);
-
-       return TRUE;
-}
-
-static void on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data)
-{
-       struct custom_data *ctx = user_data;
-       TelephonyManager *mgr;
-
-       info("DBUS Registered");
-
-       /* 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);
-
-       dbg("Aquire DBUS - COMPLETE");
-
-       /* Refresh Object */
-       g_idle_add(refresh_object, ctx);
-}
-
-struct tcore_communitor_operations ops = {
-       .send_response = send_response,
-       .send_notification = send_notification,
-};
-
-static gboolean on_load()
-{
-       dbg("i'm load!");
-
-       return TRUE;
-}
-
-static gboolean on_init(TcorePlugin *p)
-{
-       Communicator *comm;
-       struct custom_data *data;
-       guint id;
-
-       if (p == NULL)
-               return FALSE;
-
-       dbg("i'm init!");
-
-       data = calloc(sizeof(struct custom_data), 1);
-       if (data == NULL) {
-               return FALSE;
-       }
-
-       data->plugin = p;
-
-       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->objects = g_hash_table_new(g_str_hash, g_str_equal);
-       data->cached_sat_main_menu = NULL;
-
-       dbg("data = %p", data);
-
-       id = g_bus_own_name (G_BUS_TYPE_SYSTEM,
-                       MY_DBUS_SERVICE,
-                       G_BUS_NAME_OWNER_FLAGS_REPLACE,
-                       on_bus_acquired,
-                       NULL, NULL,
-                       data,
-                       NULL);
-
-       data->manager = g_dbus_object_manager_server_new (MY_DBUS_PATH);
-
-       g_idle_add(refresh_object, data);
-
-       return TRUE;
-}
-
-static void on_unload(TcorePlugin *p)
-{
-       struct custom_data *data;
-       Communicator *comm;
-
-       if (p == NULL)
-               return;
-
-       dbg("i'm unload");
-
-       comm = tcore_server_find_communicator(tcore_plugin_ref_server(p), "dbus");
-       if (comm == NULL)
-               return;
-
-       data = tcore_communicator_ref_user_data(comm);
-       if (data == NULL)
-               return;
-
-       g_hash_table_destroy(data->objects);
-
-       free(data);
-}
-
-struct tcore_plugin_define_desc plugin_define_desc =
-{
-       .name = "NEW_DBUS_COMMUNICATOR",
-       .priority = TCORE_PLUGIN_PRIORITY_HIGH,
-       .version = PLUGIN_VERSION,
-       .load = on_load,
-       .init = on_init,
-       .unload = on_unload
-};
diff --git a/src/desc.c b/src/desc.c
new file mode 100644 (file)
index 0000000..5c4eef9
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_main.h"
+#include "dtapi_util.h"
+
+#include <glib.h>
+#include <tcore.h>
+#include <plugin.h>
+
+/** @todo Static assert if True */
+#ifndef PLUGIN_VERSION
+#define PLUGIN_VERSION 1
+#endif
+
+static gboolean on_load()
+{
+       dbg("i'm load");
+       return TRUE;
+}
+
+static gboolean on_init(TcorePlugin *plugin)
+{
+       gboolean result = FALSE;
+       tcore_check_return_value_assert(NULL != plugin, FALSE);
+
+       result = dtapi_plugin_init(plugin);
+       if (result == FALSE) {
+               err("Failed intializing the plugin");
+       } else {
+               dbg("dbus-tapi-plugin INIT SUCCESS");
+       }
+
+       return result;
+}
+
+static void on_unload(TcorePlugin *plugin)
+{
+       tcore_check_return_assert(NULL != plugin);
+
+       dtapi_plugin_deinit(plugin);
+       dbg("dbus-tapi-plugin UNLOAD COMPLETE");
+}
+
+/* Plugin Descriptor */
+EXPORT_API struct tcore_plugin_define_desc plugin_define_desc = {
+       .name = "DBUS_COMMUNICATOR",
+       .priority = TCORE_PLUGIN_PRIORITY_HIGH,
+       .version = PLUGIN_VERSION,
+       .load = on_load,
+       .init = on_init,
+       .unload = on_unload
+};
diff --git a/src/dtapi_call.c b/src/dtapi_call.c
new file mode 100644 (file)
index 0000000..c10e7cd
--- /dev/null
@@ -0,0 +1,1542 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_call.h"
+#include "dtapi_util.h"
+
+#include <stdio.h>
+#include <aul.h>
+#include <appsvc.h>
+#include <bundle.h>
+#include <tcore.h>
+#include <plugin.h>
+#include <co_call.h>
+
+#define AC_CALL        "telephony_framework::api_call"
+
+static void _launch_voice_call(const TelCallIncomingInfo *incoming_call_info)
+{
+       char id[2] = {0, };
+       char cli[2] = {0, };
+       char forward[2] = {0, };
+       char active_line[2] = {0, };
+       char cna[2] = {0, };
+       char number[TEL_CALL_CALLING_NUMBER_LEN_MAX + 1] = {0, };
+       char name[TEL_CALL_CALLING_NAME_LEN_MAX + 1] = {0, };
+
+       bundle *kb  = 0;
+
+       snprintf(id, 2, "%d", incoming_call_info->call_id);
+       dbg("id : [%s]", id );
+       snprintf(cli, 2, "%d", incoming_call_info->cli_validity);
+       dbg("cli : [%s]", cli );
+       snprintf(number, TEL_CALL_CALLING_NUMBER_LEN_MAX + 1, "%s", incoming_call_info->number);
+       dbg("number : [%s]", number );
+       snprintf(forward, 2, "%d", incoming_call_info->forward);
+       dbg("forward : [%s]", forward );
+       snprintf(active_line, 2, "%d", incoming_call_info->active_line);
+       dbg("active_line : [%s]", active_line );
+
+       if (incoming_call_info->cni_validity == TEL_CALL_CNI_VALIDITY_VALID)
+               snprintf(cna, 2, "%d", 0);
+       else
+               snprintf(cna, 2, "%d", 1);
+
+       dbg("cna : [%s]", cna);
+       snprintf(name, TEL_CALL_CALLING_NAME_LEN_MAX + 1, "%s", incoming_call_info->name);
+       dbg("name : [%s]", name);
+
+       kb = bundle_create();
+       if(!kb) {
+               err("bundle creation failed");
+               return;
+       }
+       /* AppSvc */
+       appsvc_set_operation(kb, APPSVC_OPERATION_CALL);
+       appsvc_set_uri(kb,"tel:MT");
+
+       appsvc_add_data(kb, "launch-type", "MT");
+       appsvc_add_data(kb, "handle", id);
+       appsvc_add_data(kb, "number", number);
+       appsvc_add_data(kb, "name_mode", cna);
+       appsvc_add_data(kb, "name", name);
+       appsvc_add_data(kb, "clicause", cli);
+       appsvc_add_data(kb, "fwded", forward);
+       appsvc_add_data(kb, "activeline", active_line);
+
+       appsvc_run_service(kb, 0, NULL, NULL);
+       bundle_free(kb);
+}
+
+static void
+_launch_video_call(const TelCallIncomingInfo *incoming_call_info)
+{
+       char id[2] = {0, };
+       char cli[2] = {0, };
+       char forward[2] = {0, };
+       char number[TEL_CALL_CALLING_NUMBER_LEN_MAX + 1] = {0, };
+       int ret = 0;
+       bundle *kb  = 0;
+
+       snprintf( id, 2, "%d", incoming_call_info->call_id);
+       dbg("id : [%s]", id );
+       snprintf( number, TEL_CALL_CALLING_NUMBER_LEN_MAX + 1, "%s", incoming_call_info->number);
+       dbg("number : [%s]", number );
+       snprintf( cli, 2, "%d", incoming_call_info->cli_validity);
+       dbg("cli : [%s]", cli );
+       snprintf( forward, 2, "%d", incoming_call_info->forward);
+       dbg("forward : [%s]", forward );
+
+       kb = bundle_create();
+       if(!kb) {
+               err("bundle creation failed");
+               return;
+       }
+       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);
+}
+
+/* To be moved inside libtcore */
+static gboolean
+_check_call_type(TelCallType type)
+{
+       switch (type) {
+       case TEL_CALL_TYPE_VOICE:
+       case TEL_CALL_TYPE_VIDEO:
+       case TEL_CALL_TYPE_E911:
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+/* To be moved inside libtcore */
+static gboolean
+_check_call_ecc(TelCallEmergencyCategory ecc)
+{
+       switch (ecc) {
+       case TEL_CALL_ECC_DEFAULT:
+       case TEL_CALL_ECC_POLICE:
+       case TEL_CALL_ECC_AMBULANCE:
+       case TEL_CALL_ECC_FIREBRIGADE:
+       case TEL_CALL_ECC_MARINEGUARD:
+       case TEL_CALL_ECC_MOUNTAINRESCUE:
+       case TEL_CALL_ECC_MANUAL_ECALL:
+       case TEL_CALL_ECC_AUTO_ECALL:
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+/* To be moved inside libtcore */
+static gboolean
+_check_answer_type(TelCallAnswerType type)
+{
+       switch (type) {
+       case TEL_CALL_ANSWER_ACCEPT:
+       case TEL_CALL_ANSWER_REJECT:
+       case TEL_CALL_ANSWER_REPLACE:
+       case TEL_CALL_ANSWER_HOLD_AND_ACCEPT:
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+/* To be moved inside libtcore */
+static gboolean
+_check_end_type(TelCallAnswerType type)
+{
+       switch (type) {
+       case TEL_CALL_END:
+       case TEL_CALL_END_ALL:
+       case TEL_CALL_END_ACTIVE_ALL:
+       case TEL_CALL_END_HOLD_ALL:
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+static void __add_call_status_to_builder(CallObject *co, GVariantBuilder *variant_builder)
+{
+       guint call_id;
+       TelCallType call_type;
+       TelCallState call_state;
+       gboolean mo_call;
+       gboolean mpty;
+       TelCallCliValidity cli_validity;
+       gchar num[TEL_CALL_CALLING_NUMBER_LEN_MAX + 1] = {0, };
+       TelCallCniValidity cni_validity;
+       gchar name[TEL_CALL_CALLING_NAME_LEN_MAX + 1] = {0, };
+       gboolean forward;
+       TelCallActiveLine active_line;
+
+       g_variant_builder_open(variant_builder, G_VARIANT_TYPE("a{sv}"));
+       if (co != NULL) {
+                 /*
+                  * Ignore return values of tcore_call_object_get/set_xxx()
+                  * as in this case return value is always TRUE.
+                  */
+               tcore_call_object_get_id(co, &call_id);
+               g_variant_builder_add(variant_builder, "{sv}",
+                       "call_id", g_variant_new_uint32(call_id));
+
+               tcore_call_object_get_call_type(co, &call_type);
+               g_variant_builder_add(variant_builder, "{sv}",
+                       "call_type", g_variant_new_int32(call_type));
+
+               tcore_call_object_get_direction(co, &mo_call);
+               g_variant_builder_add(variant_builder, "{sv}",
+                       "mo_call", g_variant_new_boolean(mo_call));
+
+               tcore_call_object_get_state(co, &call_state);
+               g_variant_builder_add(variant_builder, "{sv}",
+                       "call_state", g_variant_new_int32(call_state));
+
+               tcore_call_object_get_multiparty_state(co, &mpty);
+               g_variant_builder_add(variant_builder, "{sv}",
+                       "mpty", g_variant_new_boolean(mpty));
+
+               tcore_call_object_get_active_line(co, &active_line);
+               g_variant_builder_add(variant_builder, "{sv}",
+                       "active_line", g_variant_new_int32(active_line));
+
+               tcore_call_object_get_cli_validity(co, &cli_validity);
+               g_variant_builder_add(variant_builder, "{sv}",
+                       "cli_validity", g_variant_new_int32(cli_validity));
+
+               tcore_call_object_get_number(co, num);
+               g_variant_builder_add(variant_builder, "{sv}",
+                       "num", g_variant_new_string(num));
+               /* the following data will be valid only in case of MT call */
+               if (mo_call == FALSE) {
+               tcore_call_object_get_cni_validity(co, &cni_validity);
+                       g_variant_builder_add(variant_builder, "{sv}",
+                               "cni_validity", g_variant_new_int32(cni_validity));
+
+                       tcore_call_object_get_name(co, name);
+                       g_variant_builder_add(variant_builder, "{sv}",
+                               "name", g_variant_new_string(name));
+
+                       tcore_call_object_get_mt_forward(co, &forward);
+                       g_variant_builder_add(variant_builder, "{sv}",
+                               "forward", g_variant_new_boolean(forward));
+               }
+       }
+       g_variant_builder_close(variant_builder);
+}
+
+static void
+on_response_dtapi_call_dial(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call dial response result: [%d]", result);
+       telephony_call_complete_dial(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_dial(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gint call_type,
+               gint ecc,
+               gchar* call_number,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelCallDial req;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+        if ((_check_call_type(call_type) == FALSE)
+                       || ((call_type == TEL_CALL_TYPE_E911)
+                       && (_check_call_ecc(ecc) == FALSE))
+                       || ((call_type != TEL_CALL_TYPE_E911)
+                       && (call_number == NULL || strlen(call_number) == 0
+                       || strlen(call_number) > TEL_CALL_CALLING_NUMBER_LEN_MAX))) {
+
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid parameter");
+               return TRUE;
+       }
+
+       req.call_type = call_type;
+       req.ecc = ecc;
+       memcpy( req.number, call_number, strlen(call_number));
+       req.number[strlen(call_number)] = '\0';
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_DIAL,
+                                       &req, sizeof(TelCallDial), on_response_dtapi_call_dial, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_answer(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call answer response result: [%d]", result);
+       telephony_call_complete_answer(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_answer(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gint answer_type,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       if (!_check_answer_type(answer_type)) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid answer type");
+               return TRUE;
+       }
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_ANSWER,
+                                       &answer_type, sizeof(gint), on_response_dtapi_call_answer, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_end(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call end response result: [%d]", result);
+       telephony_call_complete_end(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_end(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               guint call_id,
+               gint end_type,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelCallEnd req;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       if (!_check_end_type(end_type)) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid parameter");
+               return TRUE;
+       }
+
+       req.call_id= call_id;
+       req.end_type= end_type;
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_END,
+                                       &req, sizeof(TelCallEnd), on_response_dtapi_call_end, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_send_dtmf(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call send dtmf response result: [%d]", result);
+       telephony_call_complete_send_dtmf(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_send_dtmf(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gchar *dtmf_str,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       if ((dtmf_str == NULL) || (strlen(dtmf_str) == 0)) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid parameter");
+               return TRUE;
+       }
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_SEND_DTMF,
+                               dtmf_str, strlen(dtmf_str) + 1, on_response_dtapi_call_send_dtmf, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_hold(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call hold response result: [%d]", result);
+       telephony_call_complete_hold(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_hold(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_CALL_HOLD, NULL,
+                                       0, on_response_dtapi_call_hold, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_active(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call active response result: [%d]", result);
+       telephony_call_complete_active(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_active(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_ACTIVE, NULL, 0,
+                                       on_response_dtapi_call_active, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_swap(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call swap response result: [%d]", result);
+       telephony_call_complete_swap(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_swap(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_SWAP, NULL,
+                                       0, on_response_dtapi_call_swap, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_join(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call join response result: [%d]", result);
+       telephony_call_complete_join(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_join(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_JOIN,
+                                       NULL, 0, on_response_dtapi_call_join, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_split(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call split response result: [%d]", result);
+       telephony_call_complete_split(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_split(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               guint call_id,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_CALL_SPLIT, &call_id,
+                                       sizeof(guint), on_response_dtapi_call_split, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_transfer(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call transfer response result: [%d]", result);
+       telephony_call_complete_transfer(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_transfer(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_TRANSFER,
+                               NULL, 0, on_response_dtapi_call_transfer, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_deflect(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call deflect response result: [%d]", result);
+       telephony_call_complete_deflect(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_deflect(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gchar *deflect_to,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       if ((deflect_to == NULL) || ((strlen(deflect_to) == 0)
+               || (strlen(deflect_to) > TEL_CALL_CALLING_NUMBER_LEN_MAX))) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid parameter");
+               return TRUE;
+       }
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_DEFLECT,
+                               deflect_to, strlen(deflect_to) + 1, on_response_dtapi_call_deflect, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_set_active_line(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call set active line response result: [%d]", result);
+       telephony_call_complete_set_active_line(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_set_active_line(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gint active_line,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_SET_ACTIVE_LINE,
+                               &active_line, sizeof(gint), on_response_dtapi_call_set_active_line, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_get_active_line(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call get active line response result : [%d]", result);
+       telephony_call_complete_get_active_line(rsp_cb_data->interface_object, rsp_cb_data->invocation,
+               result, GPOINTER_TO_INT(data));
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_get_active_line(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_GET_ACTIVE_LINE, NULL,
+                               0, on_response_dtapi_call_get_active_line, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static gboolean
+dtapi_call_get_status(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               guint call_id,
+               gpointer user_data)
+{
+       TcorePlugin *plugin = user_data;
+       CoreObject *o = NULL;
+       CallObject *co = NULL;
+       TelCallType call_type;
+       TelCallState call_state;
+       gboolean mo_call;
+       gboolean mpty;
+       TelCallCliValidity cli_validity;
+       gchar num[TEL_CALL_CALLING_NUMBER_LEN_MAX + 1] = {0, };
+       TelCallCniValidity cni_validity;
+       gchar name[TEL_CALL_CALLING_NAME_LEN_MAX + 1] = {0, };
+       gboolean forward;
+       TelCallActiveLine active_line;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "r") == FALSE)
+               return TRUE;
+
+       o = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
+       if (!o) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid core object");
+               return TRUE;
+       }
+       co = tcore_call_object_find_by_id(o, call_id);
+       if (!co) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "No Call Object");
+               return TRUE;
+       }
+
+       tcore_call_object_get_call_type(co, &call_type);
+       tcore_call_object_get_direction(co, &mo_call);
+       tcore_call_object_get_state(co, &call_state);
+       tcore_call_object_get_multiparty_state(co, &mpty);
+       tcore_call_object_get_active_line(co, &active_line);
+       tcore_call_object_get_cli_validity(co, &cli_validity);
+       tcore_call_object_get_number(co, num);
+
+       /* the following data will be valid only in case of MT call */
+       if(mo_call == FALSE){
+               tcore_call_object_get_cni_validity(co, &cni_validity);
+               tcore_call_object_get_name(co, name);
+               tcore_call_object_get_mt_forward(co, &forward);
+       }
+
+       telephony_call_complete_get_status(call, invocation,
+               TEL_RETURN_SUCCESS, call_id, call_type,
+               call_state, mo_call, mpty,
+               cli_validity, num, cni_validity, name,
+               forward, active_line);
+
+       return TRUE;
+}
+
+static gboolean
+dtapi_call_get_status_all(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gpointer user_data)
+{
+       TcorePlugin *plugin = user_data;
+       GSList *list = NULL;
+       CoreObject *co = NULL;
+       GVariant *gv = NULL;
+       GVariantBuilder b;
+       TelCallState  state;
+       guint count = 0;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "r") == FALSE)
+               return TRUE;
+
+       /* OSP access this function already, can't modify this immediately */
+       if (!plugin) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid plugin");
+               return TRUE;
+       }
+
+       co = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
+       if (!co) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid core object");
+               return TRUE;
+       }
+
+       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+       for (state = TEL_CALL_STATE_IDLE; state <= TEL_CALL_STATE_WAITING; state++) {
+               list = tcore_call_object_find_by_status(co, state);
+               dbg("%d Calls are in [%d] state", g_slist_length(list), state);
+               while (list) {
+                       /* Update builder */
+                       __add_call_status_to_builder((CallObject *)list->data, &b);
+
+                       list = g_slist_next( list );
+                       count++;
+               }
+       }
+       gv = g_variant_builder_end(&b);
+       dbg("Total Calls: [%d]", count);
+
+       telephony_call_complete_get_status_all(call, invocation, TEL_RETURN_SUCCESS, count, gv);
+       g_variant_unref(gv);
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_set_volume_info(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call set volume info response result: [%d]", result);
+       telephony_call_complete_set_volume_info(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_set_volume_info(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gint device,
+               guint volume,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelCallVolumeInfo req;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       memset(&req, 0x0, sizeof(TelCallVolumeInfo));
+       req.device = device;
+       req.volume = volume;
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_SET_VOLUME_INFO,
+                               &req, sizeof(TelCallVolumeInfo), on_response_dtapi_call_set_volume_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_get_volume_info(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call get volume info response result: [%d]", result);
+       telephony_call_complete_get_volume_info(rsp_cb_data->interface_object, rsp_cb_data->invocation,
+               result, GPOINTER_TO_UINT(data));
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_get_volume_info(TelephonyCall *call,
+       GDBusMethodInvocation *invocation,
+       gint device,
+       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelCallSoundDevice req;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       req = device;
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_GET_VOLUME_INFO,
+                               &req, sizeof(TelCallSoundDevice), on_response_dtapi_call_get_volume_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_set_sound_path(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call set sound path response result: [%d]", result);
+       telephony_call_complete_set_sound_path(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_set_sound_path(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gint path,
+               gboolean ex_volume,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelCallSoundPathInfo req;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       memset(&req, 0x0, sizeof(TelCallSoundPathInfo));
+       req.path = path;
+       req.ex_volume = ex_volume;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_SET_SOUND_PATH,
+                               &req, sizeof(TelCallSoundPathInfo), on_response_dtapi_call_set_sound_path, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_set_mute(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call set mute response result: [%d]", result);
+       telephony_call_complete_set_mute(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_set_mute(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gboolean mute,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_SET_MUTE,
+                               &mute, sizeof(gboolean), on_response_dtapi_call_set_mute, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_get_mute_status(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call get mute status response result: [%d]", result);
+       telephony_call_complete_get_mute_status(rsp_cb_data->interface_object, rsp_cb_data->invocation, result, GPOINTER_TO_INT(data));
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_get_mute_status(TelephonyCall *call,
+       GDBusMethodInvocation *invocation,
+       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_GET_MUTE_STATUS,
+                               NULL, 0, on_response_dtapi_call_get_mute_status, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_set_sound_recording(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call set sound recording response result: [%d]", result);
+       telephony_call_complete_set_sound_recording(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_set_sound_recording(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gint recording,
+               gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_SET_SOUND_RECORDING,
+                               &recording, sizeof(gint), on_response_dtapi_call_set_sound_recording, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_call_set_sound_equalization(gint result,
+               const void *data,
+               void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+       dbg("Call set sound equalization response result: [%d]", result);
+       telephony_call_complete_set_sound_equalization(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_call_set_sound_equalization(TelephonyCall *call,
+               GDBusMethodInvocation *invocation,
+               gint equalization_mode,
+               gint direction,
+               GVariant *param,
+               gpointer user_data)
+{
+       GVariantIter *iter = NULL;
+       guint i  =  0;
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelCallSoundEqualization req;
+       TcorePlugin *plugin = user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_CALL, "x") == FALSE)
+               return TRUE;
+
+       tcore_check_return_value_assert(NULL != param, TRUE);
+       memset(&req, 0x0,sizeof(TelCallSoundEqualization));
+       req.mode = equalization_mode;
+       req.direction = direction;
+       g_variant_get(param,"aq",&iter);
+       while(g_variant_iter_loop(iter,"q", &(req.parameter[i]))) {
+               i++;
+       }
+
+       rsp_cb_data = dtapi_create_resp_cb_data(call, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request( plugin, TRUE, TCORE_COMMAND_CALL_SET_SOUND_EQUALIZATION,
+                               &req, sizeof(TelCallSoundEqualization), on_response_dtapi_call_set_sound_equalization,
+                               rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean
+dtapi_setup_call_interface(TelephonyObjectSkeleton *object,
+               TcorePlugin *plugin)
+{
+       TelephonyCall *call = telephony_call_skeleton_new();
+       tcore_check_return_value_assert(call != NULL, FALSE);
+
+       telephony_object_skeleton_set_call(object, call);
+       g_object_unref(call);
+
+       dbg("call = %p", call);
+
+       g_signal_connect(call, "handle-dial",
+               G_CALLBACK(dtapi_call_dial), plugin);
+
+       g_signal_connect(call, "handle-answer",
+               G_CALLBACK(dtapi_call_answer), plugin);
+
+       g_signal_connect(call, "handle-end",
+               G_CALLBACK(dtapi_call_end), plugin);
+
+       g_signal_connect(call, "handle-send-dtmf",
+               G_CALLBACK(dtapi_call_send_dtmf), plugin);
+
+       g_signal_connect(call, "handle-active",
+               G_CALLBACK(dtapi_call_active), plugin);
+
+       g_signal_connect(call, "handle-hold",
+               G_CALLBACK(dtapi_call_hold), plugin);
+
+       g_signal_connect(call, "handle-swap",
+               G_CALLBACK(dtapi_call_swap), plugin);
+
+       g_signal_connect(call, "handle-join",
+               G_CALLBACK(dtapi_call_join), plugin);
+
+       g_signal_connect(call, "handle-split",
+               G_CALLBACK(dtapi_call_split), plugin);
+
+       g_signal_connect(call, "handle-transfer",
+               G_CALLBACK(dtapi_call_transfer), plugin);
+
+       g_signal_connect(call, "handle-deflect",
+               G_CALLBACK(dtapi_call_deflect), plugin);
+
+       g_signal_connect(call, "handle-set-active-line",
+               G_CALLBACK(dtapi_call_set_active_line), plugin);
+
+       g_signal_connect(call, "handle-get-active-line",
+               G_CALLBACK(dtapi_call_get_active_line), plugin);
+
+       g_signal_connect(call, "handle-get-status",
+               G_CALLBACK(dtapi_call_get_status), plugin);
+
+       g_signal_connect(call, "handle-get-status-all",
+               G_CALLBACK(dtapi_call_get_status_all), plugin);
+
+       g_signal_connect(call, "handle-set-sound-path",
+               G_CALLBACK(dtapi_call_set_sound_path), plugin);
+
+       g_signal_connect(call, "handle-get-volume-info",
+               G_CALLBACK(dtapi_call_get_volume_info), plugin);
+
+       g_signal_connect(call, "handle-set-volume-info",
+               G_CALLBACK(dtapi_call_set_volume_info), plugin);
+
+       g_signal_connect(call, "handle-set-mute",
+               G_CALLBACK(dtapi_call_set_mute), plugin);
+
+       g_signal_connect(call, "handle-get-mute-status",
+               G_CALLBACK(dtapi_call_get_mute_status), plugin);
+
+       g_signal_connect(call, "handle-set-sound-recording",
+               G_CALLBACK(dtapi_call_set_sound_recording), plugin);
+
+       g_signal_connect(call, "handle-set-sound-equalization",
+               G_CALLBACK(dtapi_call_set_sound_equalization), plugin);
+
+       return TRUE;
+}
+
+gboolean
+dtapi_handle_call_notification(TelephonyObjectSkeleton *object,
+               TcorePlugin *plugin,
+               TcoreNotification command,
+               guint data_len,
+               const void *data)
+{
+       TelephonyCall *call;
+
+       tcore_check_return_value_assert(object != NULL, FALSE);
+       tcore_check_return_value_assert(plugin != NULL, FALSE);
+
+       call = telephony_object_peek_call(TELEPHONY_OBJECT(object));
+       tcore_check_return_value_assert(call != NULL, FALSE);
+
+       dbg("Call: [%p] Command: [0x%x]", call, command);
+
+       switch (command) {
+       case TCORE_NOTIFICATION_CALL_STATUS_IDLE: {
+               const TelCallStatusIdleNoti *idle = data;
+               tcore_check_return_value_assert(idle != NULL, FALSE);
+
+               dbg("[Notification] Call status idle - Call Id:[%d] Idle cause: [%d]",
+                               idle->call_id, idle->cause);
+
+               telephony_call_emit_voice_call_status_idle(call, idle->call_id, idle->cause);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_STATUS_ACTIVE: {
+               const guint *call_id = data;
+               tcore_check_return_value_assert(call_id != NULL, FALSE);
+
+               dbg("[Notification] Call status active - Call Id:[%d] ", *call_id);
+
+               telephony_call_emit_voice_call_status_active(call, *call_id);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_STATUS_HELD: {
+               const guint *call_id = data;
+               tcore_check_return_value_assert(call_id != NULL, FALSE);
+
+               dbg("[Notification] Call status held - Call Id:[%d] ", *call_id);
+
+               telephony_call_emit_voice_call_status_held(call, *call_id);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_STATUS_DIALING: {
+               const guint *call_id = data;
+               tcore_check_return_value_assert(call_id != NULL, FALSE);
+
+               dbg("[Notification] Call status dialing - Call Id:[%d] ", *call_id);
+
+               telephony_call_emit_voice_call_status_dialing(call, *call_id);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_STATUS_ALERT: {
+               const guint *call_id = data;
+               tcore_check_return_value_assert(call_id != NULL, FALSE);
+
+               dbg("[Notification] Call status alert - Call Id:[%d] ", *call_id);
+
+               telephony_call_emit_voice_call_status_alert(call, *call_id);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_STATUS_INCOMING: {
+               const TelCallIncomingInfo *incoming_call_info = (TelCallIncomingInfo *)data;
+               tcore_check_return_value_assert(incoming_call_info != NULL, FALSE);
+
+               dbg("[Notification] Call Status Incoming - Call Id:[%d] ", incoming_call_info->call_id);
+
+               telephony_call_emit_voice_call_status_incoming(call, incoming_call_info->call_id);
+
+               _launch_voice_call(incoming_call_info);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_VIDEO_CALL_STATUS_IDLE: {
+               const TelCallStatusIdleNoti *idle = data;
+               tcore_check_return_value_assert(idle != NULL, FALSE);
+
+               dbg("[Notification] Video call status idle notification - Call Id:[%d] Idle cause: [%d]",
+                       idle->call_id, idle->cause);
+
+               telephony_call_emit_video_call_status_idle(call, idle->call_id, idle->cause);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_VIDEO_CALL_STATUS_ACTIVE: {
+               const guint *call_id = data;
+               tcore_check_return_value_assert(call_id != NULL, FALSE);
+
+               dbg("[Notification] Video call status active notification - Call Id:[%d] ", *call_id);
+
+               telephony_call_emit_video_call_status_active(call, *call_id);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_VIDEO_CALL_STATUS_DIALING: {
+               const guint *call_id = data;
+               tcore_check_return_value_assert(call_id != NULL, FALSE);
+
+               dbg("[Notification] Video call status dialing - Call Id:[%d] ", *call_id);
+
+               telephony_call_emit_video_call_status_dialing(call, *call_id);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_VIDEO_CALL_STATUS_ALERT: {
+               const guint *call_id = data;
+               tcore_check_return_value_assert(call_id != NULL, FALSE);
+
+               dbg("[Notification] Video call status alert -Call Id:[%d] ", *call_id);
+
+               telephony_call_emit_video_call_status_alert(call, *call_id);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_VIDEO_CALL_STATUS_INCOMING: {
+               const TelCallIncomingInfo *incoming_call_info = (TelCallIncomingInfo *)data;
+               tcore_check_return_value_assert(incoming_call_info != NULL, FALSE);
+
+               dbg("[Notification] Video call status incoming - Call Id:[%d] ",
+                       incoming_call_info->call_id);
+
+               telephony_call_emit_video_call_status_incoming(call, incoming_call_info->call_id);
+               _launch_video_call(incoming_call_info);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MO_WAITING: {
+               dbg("[Notification] MO Waiting call info");
+
+               telephony_call_emit_mo_waiting(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MO_FORWARDED: {
+               dbg("[Notification] MO Forwarded call info");
+
+               telephony_call_emit_mo_forwarded(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MO_BARRED_INCOMING: {
+               dbg("[Notification] MO Barred incoming call info");
+
+               telephony_call_emit_mo_barred_incoming(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MO_BARRED_OUTGOING: {
+               dbg("[Notification] MO Barred outgoing call info");
+
+               telephony_call_emit_mo_barred_outgoing(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MO_FORWARD_UNCONDITIONAL: {
+               dbg("[Notification] MO Forward unconditional call info");
+
+               telephony_call_emit_mo_forward_unconditional(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MO_FORWARD_CONDITIONAL: {
+               dbg("[Notification] MO Forward conditional call info");
+
+               telephony_call_emit_mo_forward_conditional(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MO_DEFLECTED: {
+               dbg("[Notification] MO Deflected call");
+
+               telephony_call_emit_mo_deflected(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MT_FORWARDED: {
+               dbg("[Notification] MT Forwarded call");
+
+               telephony_call_emit_mt_forwarded(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_MT_DEFLECTED: {
+               dbg("[Notification] MT Deflected call");
+
+               telephony_call_emit_mt_deflected(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_TRANSFERED: {
+               dbg("[Notification] Transfered call");
+
+               telephony_call_emit_transfered(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_HELD: {
+               dbg("[Notification] Call held info");
+
+               telephony_call_emit_call_held(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_ACTIVE: {
+               dbg("[Notification] Call active info");
+
+               telephony_call_emit_call_active(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_INFO_JOINED: {
+               dbg("[Notification] Call joined info");
+
+               telephony_call_emit_call_joined(call);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_SOUND_RINGBACK_TONE: {
+               const gint *status = data;
+               tcore_check_return_value_assert(status != NULL, FALSE);
+
+               dbg("[Notification] Call sound ringback tone notification - Status:[%d] ", *status);
+
+               telephony_call_emit_call_sound_ringback_tone(call, *status);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_SOUND_WBAMR: {
+               const gint *status = (gint *)data;
+               tcore_check_return_value_assert(status != NULL, FALSE);
+
+               dbg("[Notification] Call sound WBAMR notification - Status:[%d] ", *status);
+
+               telephony_call_emit_call_sound_wbamr(call, *status);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_SOUND_EQUALIZATION: {
+               const TelCallSoundEqualizationNoti *sound_eq = data;
+               tcore_check_return_value_assert(sound_eq != NULL, FALSE);
+
+               dbg("[Notification] Call sound equalization notification - Mode:[%d] Direction:[%d]",
+                       sound_eq->mode, sound_eq->direction);
+
+               telephony_call_emit_call_sound_equalization(call, sound_eq->mode, sound_eq->direction);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_CALL_SOUND_CLOCK_STATUS: {
+               const gboolean *clock_status = data;
+               tcore_check_return_value_assert(clock_status != NULL, FALSE);
+
+               dbg("[Notification] Call sound clock status notification - Clock status:[%d]",
+                       *clock_status);
+
+               telephony_call_emit_call_sound_clock_status(call, *clock_status);
+       }
+       break;
+
+       default:
+               err("Unsupported Command");
+       break;
+       }
+
+       return TRUE;
+}
diff --git a/src/dtapi_gps.c b/src/dtapi_gps.c
new file mode 100644 (file)
index 0000000..0bc7290
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_gps.h"
+#include "dtapi_util.h"
+
+#include <plugin.h>
+#include <tel_gps.h>
+
+#define AC_GPS         "telephony_framework::api_gps"
+
+static void
+on_response_dtapi_gps_confirm_measure_pos(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result: [%d]", result);
+
+       telephony_gps_complete_confirm_measure_pos(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static void
+on_response_dtapi_gps_set_frequency_aiding(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result: [%d]", result);
+
+       telephony_gps_complete_set_frequency_aiding(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean
+dtapi_gps_confirm_measure_pos(TelephonyGps *gps, GDBusMethodInvocation *invocation,
+       gchar *data, gpointer user_data)
+{
+       TelGpsDataInfo gps_data = {0, NULL};
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       DbusRespCbData *rsp_cb_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_GPS, "w") == FALSE)
+               return TRUE;
+
+       gps_data.data = g_base64_decode(data, &gps_data.data_len);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(gps, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_GPS_CONFIRM_MEASURE_POS,
+                               &gps_data, sizeof(TelGpsDataInfo), on_response_dtapi_gps_confirm_measure_pos, rsp_cb_data);
+
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+       tcore_free(gps_data.data);
+
+       return TRUE;
+}
+
+static gboolean
+dtapi_gps_set_frequency_aiding(TelephonyGps *gps, GDBusMethodInvocation *invocation,
+       gboolean state, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_GPS, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(gps, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_GPS_SET_FREQUENCY_AIDING,
+                               &state, sizeof(gboolean), on_response_dtapi_gps_set_frequency_aiding, rsp_cb_data);
+
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_gps_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin)
+{
+       TelephonyGps *gps = telephony_gps_skeleton_new();
+       tcore_check_return_value_assert(NULL != gps, FALSE);
+
+       telephony_object_skeleton_set_gps(object, gps);
+       g_object_unref(gps);
+
+       dbg("gps = %p", gps);
+
+       g_signal_connect(gps, "handle-confirm-measure-pos",
+               G_CALLBACK(dtapi_gps_confirm_measure_pos), plugin);
+
+       g_signal_connect(gps, "handle-set-frequency-aiding",
+               G_CALLBACK(dtapi_gps_set_frequency_aiding), plugin);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_gps_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data)
+{
+       TelephonyGps *gps;
+
+       tcore_check_return_value_assert(NULL != object, FALSE);
+       gps = telephony_object_peek_gps(TELEPHONY_OBJECT(object));
+
+       switch (command) {
+       case TCORE_NOTIFICATION_GPS_ASSIST_DATA: {
+               gchar *encoded_data = NULL;
+               dbg("[NOTI] TCORE_NOTIFICATION_GPS_ASSIST_DATA");
+               tcore_check_return_value_assert(NULL != data, FALSE);
+               encoded_data = g_base64_encode((const guchar *)data, data_len);
+               telephony_gps_emit_assist_data(gps, encoded_data);
+               tcore_free(encoded_data);
+       } break;
+
+       case TCORE_NOTIFICATION_GPS_MEASURE_POSITION: {
+               gchar *encoded_data = NULL;
+               dbg("[NOTI] TCORE_NOTIFICATION_GPS_MEASURE_POSITION");
+               tcore_check_return_value_assert(NULL != data, FALSE);
+               encoded_data = g_base64_encode((const guchar *)data, data_len);
+               telephony_gps_emit_measure_position(gps, encoded_data);
+               tcore_free(encoded_data);
+       } break;
+
+       case TCORE_NOTIFICATION_GPS_RESET_ASSIST_DATA: {
+               dbg("[NOTI] TCORE_NOTIFICATION_GPS_RESET_ASSIST_DATA");
+               telephony_gps_emit_reset_assist_data(gps);
+       } break;
+
+       default: {
+               err("Unhandled command: [0x%x]", command);
+       }
+       }
+
+       return TRUE;
+}
diff --git a/src/dtapi_main.c b/src/dtapi_main.c
new file mode 100644 (file)
index 0000000..54fd41d
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_main.h"
+#include "dtapi_call.h"
+#include "dtapi_gps.h"
+#include "dtapi_modem.h"
+#include "dtapi_network.h"
+#include "dtapi_phonebook.h"
+#include "dtapi_sap.h"
+#include "dtapi_sat.h"
+#include "dtapi_sim.h"
+#include "dtapi_sms.h"
+#include "dtapi_ss.h"
+#include "dtapi_util.h"
+#include "dtapi_manager.h"
+#include "generated-code.h"
+
+#include <glib.h>
+#include <tcore.h>
+#include <server.h>
+#include <communicator.h>
+#include <core_object.h>
+#include <plugin.h>
+#include <storage.h>
+
+#include "sat_manager.h"
+
+#define DBUS_COMMUNICATOR_NAME "dbus"
+
+typedef struct {
+       TcorePlugin *plugin;
+       Communicator *comm;
+       Server *server;
+       guint bus_id;
+
+       GHashTable *objects;
+       GDBusObjectManagerServer *manager;
+} CustomData;
+
+static void __set_telephony_ready(Server *server)
+{
+       TcoreStorage *strg;
+       gboolean ret;
+
+       strg = tcore_server_find_storage(server, "vconf");
+       ret = tcore_storage_set_bool(strg, STORAGE_KEY_READY, TRUE);
+       if (ret == TRUE) {
+               dbg("Set Telephony Ready: [%s]", ret ? "SUCCESS" : "FAIL");
+       }
+}
+
+static gboolean __is_server_notification(gint cmd)
+{
+       return ((cmd & (TCORE_NOTIFICATION | 0x0FF00000))
+                       == TCORE_SERVER_NOTIFICATION);
+}
+
+static void __add_modem(TcorePlugin *plugin, CustomData *ctx)
+{
+       TelephonyObjectSkeleton *object;
+       CoreObject *co;
+       guint co_type;
+       char *path = NULL;
+       GSList *co_list, *co_elem;
+       const char *cp_name;
+
+       dbg("Entry");
+
+       /* Get CP Name */
+       cp_name = tcore_server_get_cp_name_by_plugin(plugin);
+       if (cp_name == NULL) {
+               err("CP Name is NULL");
+               return;
+       }
+
+       co_list = tcore_plugin_ref_core_objects(plugin);
+       if (co_list == NULL) {
+               err("No Core Objects");
+               return;
+       }
+
+       path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, cp_name);
+       dbg("PATH: [%s]", path);
+
+       object = g_hash_table_lookup(ctx->objects, path);
+       if (object == NULL) {
+               /* Create a new D-Bus object at path /org/tizen/telephony/<cp_name> */
+               object = telephony_object_skeleton_new(path);
+               if (object == NULL) {
+                       err("Creation of new DBUS Interface object failed");
+                       goto OUT;
+               }
+               dbg("New DBUS Interface object created!!! (object = %p)", object);
+               g_hash_table_insert(ctx->objects, g_strdup(path), object);
+       } else {                /* DBUS object already exists */
+               dbg("DBUS Interface object already created!!! (object = %p)", object);
+               goto OUT;
+       }
+
+       /* Export interfaces rooted at /org/tizen/telephony/<cp_name> */
+       for (co_elem = co_list; co_elem; co_elem = co_elem->next) {
+               co = co_elem->data;
+               co_type = tcore_object_get_type(co);
+               switch (co_type) {
+               case CORE_OBJECT_TYPE_MODEM:
+                       dtapi_setup_modem_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_CALL:
+                       dtapi_setup_call_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_NETWORK:
+                       dtapi_setup_network_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_SS:
+                       dtapi_setup_ss_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_SMS:
+                       dtapi_setup_sms_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_SIM:
+                       dtapi_setup_sim_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_PHONEBOOK:
+                       dtapi_setup_phonebook_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_SAP:
+                       dtapi_setup_sap_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_GPS:
+                       dtapi_setup_gps_interface(object, plugin);
+               break;
+
+               case CORE_OBJECT_TYPE_SAT:
+                       dtapi_setup_sat_interface(object, plugin, ctx->plugin);
+               break;
+
+               default:
+                       msg("Skipping: [%u]", co_type);
+               continue;
+               }
+       }
+       /* Export the object */
+       g_dbus_object_manager_server_export(ctx->manager, G_DBUS_OBJECT_SKELETON(object));
+
+       if (g_dbus_object_manager_server_get_connection (ctx->manager) != NULL)
+               __set_telephony_ready(ctx->server);
+
+       g_object_unref(object);
+
+OUT:
+       /* Freeing memory */
+       g_free(path);
+}
+
+static void __refresh_modems(CustomData *ctx)
+{
+       GSList *mp_list;
+
+       if (!ctx->manager) {
+               err("Lost Manager. Can't continue");
+               return;
+       }
+
+       /* Expose modem plugin interface */
+       mp_list = tcore_server_get_modem_plugin_list(ctx->server);
+       g_slist_foreach(mp_list, (GFunc)__add_modem, ctx);
+       g_slist_free(mp_list);
+}
+
+static TelReturn send_notification(Communicator *comm,
+       TcorePlugin *plugin, gint command,
+       unsigned int data_len, const void *data)
+{
+       CustomData *ctx = NULL;
+       gboolean ret = FALSE;
+
+       dbg("Notification!!! command: [0x%x] data: [%p] data_len: [%d]",
+                       command, data, data_len);
+
+       if (command == TCORE_SERVER_NOTIFICATION_ADDED_COMMUNICATOR) {
+               /* In case of ADDED_COMMUNICATOR, do NOT progress */
+               return TEL_RETURN_SUCCESS;
+       }
+
+       ctx = tcore_communicator_ref_user_data(comm);
+       tcore_check_return_value_assert((ctx != NULL),
+                       TEL_RETURN_INVALID_PARAMETER);
+
+       /*
+        * Notifications are classified into -
+        *      Server (System) notifications
+        *      Module notifications
+        */
+       if (__is_server_notification(command) == TRUE) {
+               dbg("Server (System) Notification");
+
+               switch (command) {
+               case TCORE_SERVER_NOTIFICATION_ADDED_MODEM_PLUGIN:
+                       dbg("Modem Plug-in (%s) is added... "
+                               "Exporting interfaces for the modem",
+                               tcore_server_get_cp_name_by_plugin((TcorePlugin*)data));
+
+                       __add_modem((TcorePlugin*)data, ctx);
+
+                       ret = TRUE;
+               break;
+
+               default:
+                       warn("Unsupported System notification: (0x%x)", command);
+               break;
+               }
+       } else {
+               TelephonyObjectSkeleton *object;
+               const char *cp_name;
+               char *path;
+
+               cp_name = tcore_server_get_cp_name_by_plugin(plugin);
+               tcore_check_return_value_assert((cp_name != NULL), TEL_RETURN_FAILURE);
+
+               dbg("CP Name: [%s]", cp_name);
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, cp_name);
+
+               /* Look-up Hash table for Object */
+               object = g_hash_table_lookup(ctx->objects, path);
+               dbg("Path: [%s] Interface object: [%p]", path, object);
+               g_free(path);
+
+               tcore_check_return_value((object != NULL), TEL_RETURN_FAILURE);
+
+               switch (command & (TCORE_NOTIFICATION | 0x0FF00000)) {
+               case TCORE_NOTIFICATION_CALL:
+                       ret = dtapi_handle_call_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_SS:
+                       ret = dtapi_handle_ss_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_PS:
+                       warn("PS Notification [0x%x]... Not handled!!!", command);
+               break;
+
+               case TCORE_NOTIFICATION_SIM:
+                       ret = dtapi_handle_sim_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_SAP:
+                       ret = dtapi_handle_sap_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_PHONEBOOK:
+                       ret = dtapi_handle_phonebook_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_MODEM:
+                       ret = dtapi_handle_modem_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_SMS:
+                       ret = dtapi_handle_sms_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_SAT:
+                       ret = dtapi_handle_sat_notification(object,
+                                       plugin, ctx->plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_NETWORK:
+                       ret = dtapi_handle_network_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_GPS:
+                       ret = dtapi_handle_gps_notification(object,
+                                       plugin, command, data_len, data);
+               break;
+
+               case TCORE_NOTIFICATION_CUSTOM:
+                       warn("Custom Notification [0x%x]... Not handled!!!", command);
+               break;
+
+               default:
+                       err("Unknown command [0x%x]", command);
+               break;
+               }
+       }
+
+       if (ret == TRUE)
+               return TEL_RETURN_SUCCESS;
+       else
+               return TEL_RETURN_FAILURE;
+}
+
+static void on_name_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data)
+{
+       dbg("Name Acquired %s", name);
+}
+
+static void on_name_lost(GDBusConnection *conn, const gchar *name, gpointer user_data)
+{
+       if (conn == NULL) {
+               err("Connection to the bus can't be made");
+               return;
+       }
+
+       dbg("Name Lost %s", name);
+
+       /* TODO: unregister the objects */
+}
+
+static void on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data)
+{
+       CustomData *ctx = user_data;
+       GError *error = NULL;
+       TelephonyManager *mgr = dtapi_manager_new(ctx->server);
+
+       if (FALSE == g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(mgr),
+                                       conn, TELEPHONY_OBJECT_PATH, &error)) {
+               err("Unable to export Manager interface [%d] => [%s]", error->code, error->message);
+               g_error_free(error);
+               return;
+       }
+
+       /* Refresh Object */
+       __refresh_modems(ctx);
+
+       /* Export all objects */
+       g_dbus_object_manager_server_set_connection(ctx->manager, conn);
+       dbg("Aquire DBUS - COMPLETE");
+}
+
+TcoreCommunicatorOps ops = {
+       .send_notification = send_notification,
+};
+
+gboolean dtapi_plugin_init(TcorePlugin *plugin)
+{
+       Communicator *comm;
+       CustomData *data;
+
+       data = tcore_malloc0(sizeof(CustomData));
+
+       data->plugin = plugin;
+       data->server = tcore_plugin_ref_server(plugin);
+
+       comm = tcore_communicator_new(plugin, DBUS_COMMUNICATOR_NAME, &ops);
+       tcore_communicator_link_user_data(comm, data);
+       data->comm = comm;
+
+       data->objects = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
+
+       /* Create Object Manager rooted at /org/tizen/telephony */
+       data->manager = g_dbus_object_manager_server_new(TELEPHONY_OBJECT_PATH);
+
+       /* Request bus name */
+       data->bus_id = g_bus_own_name(G_BUS_TYPE_SYSTEM, TELEPHONY_SERVICE,
+                                       G_BUS_NAME_OWNER_FLAGS_REPLACE,
+                                       on_bus_acquired, on_name_acquired, on_name_lost,
+                                       data, NULL);
+       dbg("id=[%d]", data->bus_id);
+
+       sat_manager_init(plugin, data->objects, data->server, data->manager);
+
+       return TRUE;
+}
+
+void dtapi_plugin_deinit(TcorePlugin *plugin)
+{
+       CustomData *data;
+       Communicator *comm;
+       Server *s = tcore_plugin_ref_server(plugin);
+
+       comm = tcore_server_find_communicator(s, DBUS_COMMUNICATOR_NAME);
+       data = tcore_communicator_ref_user_data(comm);
+       if (!data) {
+               tcore_communicator_free(comm);
+               return;
+       }
+       g_hash_table_destroy(data->objects);
+       g_bus_unown_name(data->bus_id);
+       g_object_unref(data->manager);
+       tcore_free(data);
+       sat_manager_deinit(plugin);
+
+       tcore_communicator_free(comm);
+}
diff --git a/src/dtapi_manager.c b/src/dtapi_manager.c
new file mode 100644 (file)
index 0000000..cde5a1b
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_manager.h"
+#include "dtapi_util.h"
+
+#include <server.h>
+
+#define AC_MANAGER     "telephony_framework::api_manager"
+
+static void
+dtapi_manager_get_modems(TelephonyManager *mgr, GDBusMethodInvocation *invocation,
+       Server *server)
+{
+       GSList *cp_name_list, *temp_list;
+       gchar **list;
+       unsigned int count;
+       const char *name = NULL;
+       dbg("Entry");
+
+       cp_name_list = tcore_server_get_modem_plugin_list(server);
+       if (cp_name_list == NULL) {
+               err("Modem List is NULL");
+               telephony_manager_complete_get_modems(mgr, invocation, NULL);
+               return;
+       }
+
+       count = g_slist_length(cp_name_list);
+       list = g_try_malloc0(sizeof(gchar *) * (count+1));
+
+       count = 0;
+       temp_list = cp_name_list;
+       for ( ; cp_name_list ; cp_name_list = cp_name_list->next) {
+               name = cp_name_list->data;
+               list[count] = g_strdup(name);
+               dbg("list[%d]: %s", count, list[count]);
+               count++;
+       }
+
+       telephony_manager_complete_get_modems(mgr, invocation, (const gchar **)list);
+
+       /* Free memory */
+       for (;count > 0; count--)
+               g_free(list[count]);
+
+       g_free(list);
+
+       /* Freeing the received list of CP names */
+       g_slist_free_full(temp_list, g_free);
+}
+
+TelephonyManager *dtapi_manager_new(Server *server)
+{
+       TelephonyManager *mgr = telephony_manager_skeleton_new();
+       tcore_check_return_value_assert(NULL != mgr, NULL);
+
+       g_signal_connect(mgr, "handle-get-modems",
+               G_CALLBACK(dtapi_manager_get_modems), server);
+
+       return mgr;
+}
diff --git a/src/dtapi_modem.c b/src/dtapi_modem.c
new file mode 100644 (file)
index 0000000..dba0e91
--- /dev/null
@@ -0,0 +1,367 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_modem.h"
+#include "dtapi_util.h"
+
+#include <plugin.h>
+#include <tel_modem.h>
+
+#define AC_MODEM       "telephony_framework::api_modem"
+
+static void on_response_dtapi_modem_set_power_status(gint result,
+       const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result: [%d]", result);
+
+       telephony_modem_complete_set_power_status(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static void on_response_dtapi_modem_set_flight_mode(gint result,
+       const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result: [%d]", result);
+
+       telephony_modem_complete_set_flight_mode(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static void on_response_dtapi_modem_get_flight_mode(gint result,
+       const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       TelModemFlightModeStatus flight_mode_status = TEL_MODEM_FLIGHT_MODE_OFF;
+       gboolean enable;
+
+       tcore_check_return_assert(NULL != rsp_cb_data && NULL != response);
+
+       enable = *(gboolean *)response;
+       dbg("result: [%d] Flight mode: [%s]", result, (enable ? "ON" : "OFF"));
+
+       telephony_modem_complete_get_flight_mode(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, enable);
+
+       tcore_free(rsp_cb_data);
+
+       if (enable == TRUE)
+               flight_mode_status = TEL_MODEM_FLIGHT_MODE_ON;
+
+       /* Update property */
+       telephony_modem_set_flight_mode_status(rsp_cb_data->interface_object, flight_mode_status);
+}
+
+static void on_response_dtapi_modem_get_version(gint result,
+       const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       const TelModemVersion *version = response;
+
+       tcore_check_return_assert(NULL != rsp_cb_data && NULL != version);
+
+       dbg("result: [%d] SW: [%s] HW: [%s] CAL: [%s] PC: [%s]", result,
+               version->software_version, version->hardware_version,
+               version->calibration_date, version->product_code);
+
+       /* Send response */
+       telephony_modem_complete_get_version(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result,
+               (const gchar *)version->software_version,
+               (const gchar *)version->hardware_version,
+               (const gchar *)version->calibration_date,
+               (const gchar *)version->product_code);
+
+       /* Update property */
+       {
+               GVariantBuilder var_builder;
+               GVariant *var_version = NULL;
+
+               g_variant_builder_init(&var_builder, G_VARIANT_TYPE("a{sv}"));
+
+               g_variant_builder_add(&var_builder, "{sv}",
+                       "software_version", g_variant_new_string(version->software_version));
+               g_variant_builder_add(&var_builder, "{sv}",
+                       "hardware_version", g_variant_new_string(version->hardware_version));
+               g_variant_builder_add(&var_builder, "{sv}",
+                       "calibration_date", g_variant_new_string(version->hardware_version));
+               g_variant_builder_add(&var_builder, "{sv}",
+                       "product_code", g_variant_new_string(version->product_code));
+
+               var_version = g_variant_builder_end(&var_builder);
+               tcore_check_return_assert(NULL != var_version);
+
+               /* Set property */
+               telephony_modem_set_version(rsp_cb_data->interface_object, var_version);
+       }
+
+       tcore_free(rsp_cb_data);
+}
+
+static void on_response_dtapi_modem_get_imei(gint result,
+       const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       const gchar *imei = response;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result: [%d] IMEI: [%s]", result, (imei ? imei : "\0"));
+
+       telephony_modem_complete_get_imei(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, imei);
+
+       tcore_free(rsp_cb_data);
+
+       /* Update property */
+       telephony_modem_set_imei(rsp_cb_data->interface_object, imei);
+}
+
+static gboolean dtapi_modem_set_power_status(TelephonyModem *modem,
+       GDBusMethodInvocation *invocation,
+       TelModemPowerStatus status, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_MODEM, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(modem, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_MODEM_SET_POWER_STATUS,
+               &status, sizeof(TelModemPowerStatus),
+               on_response_dtapi_modem_set_power_status, rsp_cb_data);
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static gboolean dtapi_modem_set_flight_mode(TelephonyModem *modem,
+       GDBusMethodInvocation *invocation,
+       gboolean enable, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_MODEM, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(modem, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_MODEM_SET_FLIGHTMODE,
+               &enable, sizeof(gboolean),
+               on_response_dtapi_modem_set_flight_mode, rsp_cb_data);
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static gboolean dtapi_modem_get_flight_mode(TelephonyModem *modem,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_MODEM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(modem, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_MODEM_GET_FLIGHTMODE,
+               NULL, 0,
+               on_response_dtapi_modem_get_flight_mode, rsp_cb_data);
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static gboolean dtapi_modem_get_version(TelephonyModem *modem,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_MODEM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(modem, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_MODEM_GET_VERSION,
+               NULL, 0,
+               on_response_dtapi_modem_get_version, rsp_cb_data);
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static gboolean dtapi_modem_get_imei(TelephonyModem *modem,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_MODEM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(modem, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_MODEM_GET_IMEI,
+               NULL, 0,
+               on_response_dtapi_modem_get_imei, rsp_cb_data);
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_modem_interface(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin)
+{
+       TelephonyModem *modem = telephony_modem_skeleton_new();
+       tcore_check_return_value_assert(NULL != modem, FALSE);
+
+       telephony_object_skeleton_set_modem(object, modem);
+       g_object_unref(modem);
+
+       dbg("modem = %p", modem);
+
+       g_signal_connect(modem,
+               "handle-set-power-status",
+               G_CALLBACK(dtapi_modem_set_power_status), plugin);
+
+       g_signal_connect(modem,
+               "handle-set-flight-mode",
+               G_CALLBACK(dtapi_modem_set_flight_mode), plugin);
+
+       g_signal_connect(modem,
+               "handle-get-flight-mode",
+               G_CALLBACK(dtapi_modem_get_flight_mode), plugin);
+
+       g_signal_connect(modem,
+               "handle-get-version",
+               G_CALLBACK(dtapi_modem_get_version), plugin);
+
+       g_signal_connect(modem,
+               "handle-get-imei",
+               G_CALLBACK(dtapi_modem_get_imei), plugin);
+
+       /* Initialize D-Bus properties */
+       telephony_modem_set_status(modem, TEL_MODEM_POWER_OFF);
+       telephony_modem_set_flight_mode_status(modem, TEL_MODEM_FLIGHT_MODE_UNKNOWN);
+       telephony_modem_set_imei(modem, NULL);
+       telephony_modem_set_version(modem, NULL);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_modem_notification(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin, TcoreNotification command,
+       guint data_len, const void *data)
+{
+       TelephonyModem *modem;
+
+       tcore_check_return_value_assert(NULL != object, FALSE);
+       modem = telephony_object_peek_modem(TELEPHONY_OBJECT(object));
+
+       switch (command) {
+       case TCORE_NOTIFICATION_MODEM_POWER: {
+               guint power_status;
+
+               tcore_check_return_value_assert(NULL != data, FALSE);
+
+               power_status = *(guint *)data;
+               dbg("modem: [%p] Power status: [%d]", modem, power_status);
+
+               /* Update property */
+               telephony_modem_set_status(modem, power_status);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_MODEM_FLIGHT_MODE: {
+               TelModemFlightModeStatus flight_mode_status = TEL_MODEM_FLIGHT_MODE_OFF;
+               gboolean status;
+
+               tcore_check_return_value_assert(NULL != data, FALSE);
+
+               status = *(gboolean *)data;
+               dbg("modem: [%p] Flight Mode status: %d",
+                       modem, (status ? "ON" : "OFF"));
+
+               if (status == TRUE)
+                       flight_mode_status = TEL_MODEM_FLIGHT_MODE_ON;
+
+               /* Update property */
+               telephony_modem_set_flight_mode_status(modem, flight_mode_status);
+       }
+       break;
+
+       default:
+               err("Unhandled command: [0x%x]", command);
+       break;
+       }
+
+       return TRUE;
+}
+
diff --git a/src/dtapi_network.c b/src/dtapi_network.c
new file mode 100644 (file)
index 0000000..bf89dc8
--- /dev/null
@@ -0,0 +1,781 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_network.h"
+#include "dtapi_util.h"
+
+#include <plugin.h>
+
+#define AC_NETWORK     "telephony_framework::api_network"
+
+static void on_response_dtapi_network_get_identity_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelNetworkIdentityInfo *identity_info = data;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+
+       if ((result != TEL_NETWORK_RESULT_SUCCESS)
+                       || (identity_info == NULL)) {
+               telephony_network_complete_get_identity_info(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result, NULL, NULL, NULL);
+       } else {
+               dbg("plmn[%s] short_name[%s] long_name[%s]",
+                               identity_info->plmn,
+                               identity_info->short_name,
+                               identity_info->long_name);
+               telephony_network_complete_get_identity_info(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result, identity_info->plmn,
+                       identity_info->short_name, identity_info->long_name);
+       }
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_get_identity_info(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_GET_IDENTITY_INFO,
+               NULL, 0,
+               on_response_dtapi_network_get_identity_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_search(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelNetworkPlmnList *plmn_list = data;
+
+       GVariant *network_list = NULL;
+       GVariantBuilder variant_builder;
+
+       guint count = 0;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+
+       g_variant_builder_init(&variant_builder, G_VARIANT_TYPE("aa{sv}"));
+       if ((result == TEL_SIM_RESULT_SUCCESS)
+                       && (plmn_list != NULL)) {
+               GVariantBuilder variant_builder2;
+               GVariant *network_identity = NULL;
+
+               dbg("Network Search PLMN List count: [%d]", plmn_list->count);
+               for (count = 0; count < plmn_list->count; count++) {
+                       g_variant_builder_open(&variant_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "plmn_status", g_variant_new_int32(plmn_list->network_list[count].plmn_status));
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "act", g_variant_new_int32(plmn_list->network_list[count].act));
+
+                       g_variant_builder_init(&variant_builder2, G_VARIANT_TYPE("a{sv}"));
+                       g_variant_builder_add(&variant_builder2, "{sv}",
+                               "plmn",
+                               g_variant_new_string(plmn_list->network_list[count].network_identity.plmn));
+                       g_variant_builder_add(&variant_builder2, "{sv}",
+                               "short_name",
+                               g_variant_new_string(plmn_list->network_list[count].network_identity.short_name));
+                       g_variant_builder_add(&variant_builder2, "{sv}",
+                               "long_name",
+                               g_variant_new_string(plmn_list->network_list[count].network_identity.long_name));
+                       network_identity = g_variant_builder_end(&variant_builder2);
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "network_identity", network_identity);
+
+                       g_variant_builder_close(&variant_builder);
+
+                       dbg("[%d] : PLMN Status: [%d] AcT: [%d]", count,
+                               plmn_list->network_list[count].plmn_status,
+                               plmn_list->network_list[count].act);
+               }
+       }
+       network_list = g_variant_builder_end(&variant_builder);
+
+       telephony_network_complete_search(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, count, network_list);
+       g_variant_unref(network_list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_search(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "x") == FALSE)
+                       return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_SEARCH,
+               NULL, 0,
+               on_response_dtapi_network_search, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_cancel_search(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+       telephony_network_complete_cancel_search(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_cancel_search(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "x") == FALSE)
+                       return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_CANCEL_SEARCH,
+               NULL, 0,
+               on_response_dtapi_network_cancel_search, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_select_automatic(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+       telephony_network_complete_select_automatic(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_select_automatic(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "w") ==  FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_SELECT_AUTOMATIC,
+               NULL, 0,
+               on_response_dtapi_network_select_automatic, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_select_manual(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+       telephony_network_complete_select_manual(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_select_manual(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation,
+       const gchar *plmn, gint act, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result ;
+       TelNetworkSelectManualInfo req_data;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "w") == FALSE)
+                       return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+
+       req_data.plmn = (char *)plmn;
+       req_data.act = act;
+
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_SELECT_MANUAL,
+               &req_data, sizeof(TelNetworkSelectManualInfo),
+               on_response_dtapi_network_select_manual, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_get_selection_mode(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       TelNetworkSelectionMode selection_mode = 0;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+       if ((result == TEL_NETWORK_RESULT_SUCCESS)
+                       && (NULL != data)) {
+               selection_mode = *(TelNetworkSelectionMode *)data;
+               dbg("selection_mode[%d]", selection_mode);
+       }
+
+       telephony_network_complete_get_selection_mode(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, selection_mode);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_get_selection_mode(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result ;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "r") ==  FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_GET_SELECTION_MODE,
+               NULL, 0,
+               on_response_dtapi_network_get_selection_mode, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_set_preferred_plmn(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+       telephony_network_complete_set_preferred_plmn(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_set_preferred_plmn(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation,
+       guint index, const gchar *plmn, gint act, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result ;
+       TelNetworkPreferredPlmnInfo req_data;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+       req_data.index = index;
+       req_data.plmn = (char *)plmn;
+       req_data.act = act;
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_SET_PREFERRED_PLMN,
+               &req_data, sizeof(TelNetworkPreferredPlmnInfo),
+               on_response_dtapi_network_set_preferred_plmn, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_get_preferred_plmn(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelNetworkPreferredPlmnList *plmn_list = data;
+
+       GVariant *list = NULL;
+       GVariantBuilder variant_builder;
+
+       guint count = 0;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+
+       g_variant_builder_init(&variant_builder, G_VARIANT_TYPE("aa{sv}"));
+       if ((result == TEL_SIM_RESULT_SUCCESS)
+                       && (NULL != plmn_list)) {
+               dbg("Preferred PLMN List count: [%d]", plmn_list->count);
+               for (count = 0; count < plmn_list->count; count++) {
+                       g_variant_builder_open(&variant_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "index", g_variant_new_uint32(plmn_list->list[count].index));
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "plmn", g_variant_new_string(plmn_list->list[count].plmn));
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "act", g_variant_new_int32(plmn_list->list[count].act));
+
+                       g_variant_builder_close(&variant_builder);
+
+                       dbg("[%d] : Index: [%d] PLMN: [%s] AcT: [%d]", count,
+                               plmn_list->list[count].index,
+                               plmn_list->list[count].plmn,
+                               plmn_list->list[count].act);
+               }
+       }
+       list = g_variant_builder_end(&variant_builder);
+
+       telephony_network_complete_get_preferred_plmn(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, count, list);
+       g_variant_unref(list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_get_preferred_plmn(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result ;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_GET_PREFERRED_PLMN,
+               NULL, 0,
+               on_response_dtapi_network_get_preferred_plmn, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_set_mode(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+       telephony_network_complete_set_mode(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_set_mode(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation,
+       gint mode, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result ;
+       TelNetworkMode network_mode;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+
+       network_mode = mode;
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_SET_MODE,
+               &network_mode, sizeof(TelNetworkMode),
+               on_response_dtapi_network_set_mode, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_get_mode(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       TelNetworkMode network_mode = 0;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+       if ((result == TEL_SIM_RESULT_SUCCESS)
+                       && (data != NULL)) {
+               network_mode = *(TelNetworkMode *)data;
+               dbg("network_mode[%d]", network_mode);
+       }
+
+       telephony_network_complete_get_mode(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, network_mode);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_get_mode(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_GET_MODE,
+               NULL, 0,
+               on_response_dtapi_network_get_mode, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_network_get_ngbr_cell_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelNetworkNeighbourCellInfo *ngbr_cell_info = data;
+
+       GVariantBuilder gsm_var_builder;
+       GVariant *gsm_list = NULL;
+       guint gsm_count = 0;
+
+       GVariantBuilder umts_var_builder;
+       GVariant *umts_list = NULL;
+       guint umts_count = 0;
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("result[%d]", result);
+
+       g_variant_builder_init(&gsm_var_builder, G_VARIANT_TYPE("aa{sv}"));
+       g_variant_builder_init(&umts_var_builder, G_VARIANT_TYPE("aa{sv}"));
+       if ((result == TEL_SIM_RESULT_SUCCESS)
+                       && (ngbr_cell_info != NULL)) {
+               dbg("GSM Cell info List count: [%d]", ngbr_cell_info->gsm_list_count);
+               for (gsm_count = 0; gsm_count < ngbr_cell_info->gsm_list_count; gsm_count++) {
+                       g_variant_builder_open(&gsm_var_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "cell_id",
+                               g_variant_new_int32(ngbr_cell_info->gsm_list[gsm_count].cell_id));
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "lac",
+                               g_variant_new_int32(ngbr_cell_info->gsm_list[gsm_count].lac));
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "bcch",
+                               g_variant_new_int32(ngbr_cell_info->gsm_list[gsm_count].bcch));
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "bsic",
+                               g_variant_new_int32(ngbr_cell_info->gsm_list[gsm_count].bsic));
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "rxlev",
+                               g_variant_new_int32(ngbr_cell_info->gsm_list[gsm_count].rxlev));
+
+                       g_variant_builder_close(&gsm_var_builder);
+               }
+
+               dbg("UMTS Cell info List count: [%d]", ngbr_cell_info->umts_list_count);
+               for (umts_count = 0; umts_count < ngbr_cell_info->umts_list_count; umts_count++) {
+                       g_variant_builder_open(&gsm_var_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "cell_id",
+                               g_variant_new_int32(ngbr_cell_info->umts_list[umts_count].cell_id));
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "lac",
+                               g_variant_new_int32(ngbr_cell_info->umts_list[umts_count].lac));
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "arfcn",
+                               g_variant_new_int32(ngbr_cell_info->umts_list[umts_count].arfcn));
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "psc",
+                               g_variant_new_int32(ngbr_cell_info->umts_list[umts_count].psc));
+                       g_variant_builder_add(&gsm_var_builder, "{sv}",
+                               "rscp",
+                               g_variant_new_int32(ngbr_cell_info->umts_list[umts_count].rscp));
+
+                       g_variant_builder_close(&gsm_var_builder);
+               }
+
+               dbg("GSM Cell info count: [%d] UMTS Cell info count: [%d]",
+                       gsm_count, umts_count);
+       }
+       gsm_list = g_variant_builder_end(&gsm_var_builder);
+       umts_list = g_variant_builder_end(&umts_var_builder);
+
+       telephony_network_complete_get_ngbr_cell_info(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result,
+               gsm_count, gsm_list, umts_count, umts_list);
+       g_variant_unref(gsm_list);
+       g_variant_unref(umts_list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_network_get_ngbr_cell_info(TelephonyNetwork *network,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelReturn result ;
+
+       if (dtapi_check_access_control(invocation, AC_NETWORK, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(network, invocation, NULL, 0);
+       result = tcore_plugin_dispatch_request(user_data, TRUE,
+               TCORE_COMMAND_NETWORK_GET_NEIGHBORING_CELL_INFO,
+               NULL, 0,
+               on_response_dtapi_network_get_ngbr_cell_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_network_interface(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin)
+{
+       TelephonyNetwork *network;
+
+       tcore_check_return_value_assert(NULL != object, FALSE);
+\r      tcore_check_return_value_assert(NULL != plugin, FALSE);
+
+       network = telephony_network_skeleton_new();
+       telephony_object_skeleton_set_network(object, network);
+       g_object_unref(network);
+
+       dbg("network = %p", network);
+
+       g_signal_connect (network,
+                       "handle-get-identity-info",
+                       G_CALLBACK (dtapi_network_get_identity_info),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-search",
+                       G_CALLBACK (dtapi_network_search),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-cancel-search",
+                       G_CALLBACK (dtapi_network_cancel_search),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-select-automatic",
+                       G_CALLBACK (dtapi_network_select_automatic),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-select-manual",
+                       G_CALLBACK (dtapi_network_select_manual),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-get-selection-mode",
+                       G_CALLBACK (dtapi_network_get_selection_mode),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-set-preferred-plmn",
+                       G_CALLBACK (dtapi_network_set_preferred_plmn),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-get-preferred-plmn",
+                       G_CALLBACK (dtapi_network_get_preferred_plmn),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-set-mode",
+                       G_CALLBACK (dtapi_network_set_mode),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-get-mode",
+                       G_CALLBACK (dtapi_network_get_mode),
+                       plugin);
+
+       g_signal_connect (network,
+                       "handle-get-ngbr-cell-info",
+                       G_CALLBACK (dtapi_network_get_ngbr_cell_info),
+                       plugin);
+
+       /* Initialize D-Bus properties */
+       telephony_network_set_rssi(network, 0);
+       telephony_network_set_lac(network, -1);
+       telephony_network_set_cell_id(network, -1);
+       telephony_network_set_rac(network, -1);
+       telephony_network_set_act(network, TEL_NETWORK_ACT_UNKNOWN);
+       telephony_network_set_cs_status(network, TEL_NETWORK_REG_STATUS_UNKNOWN);
+       telephony_network_set_ps_status(network, TEL_NETWORK_REG_STATUS_UNKNOWN);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_network_notification(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin, TcoreNotification command,
+       guint data_len, const void *data)
+{
+       TelephonyNetwork *network;
+
+       tcore_check_return_value_assert(NULL != object, FALSE);
+       tcore_check_return_value_assert(NULL != plugin, FALSE);
+\r      tcore_check_return_value_assert(NULL != data, FALSE);
+
+       network = telephony_object_peek_network(TELEPHONY_OBJECT(object));
+       tcore_check_return_value_assert(NULL != network, FALSE);
+
+       dbg("Notification!!! Command: [0x%x]", command);
+
+       switch (command) {
+       case TCORE_NOTIFICATION_NETWORK_REGISTRATION_STATUS: {
+               const TelNetworkRegStatusInfo *registration_status = data;
+
+               /* Update properties */
+               telephony_network_set_act(network, registration_status->act);
+               telephony_network_set_cs_status(network, registration_status->cs_status);
+               telephony_network_set_ps_status(network, registration_status->ps_status);
+
+               telephony_network_emit_registration_status(network,
+                               registration_status->cs_status,
+                               registration_status->ps_status,
+                               registration_status->act);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_NETWORK_LOCATION_CELLINFO: {
+               const TelNetworkCellInfo *cell_info = data;
+
+               /* Update properties */
+               telephony_network_set_lac(network, cell_info->lac);
+               telephony_network_set_cell_id(network, cell_info->cell_id);
+               telephony_network_set_rac(network, cell_info->rac);
+
+               telephony_network_emit_cell_info(network,
+                               cell_info->lac,
+                               cell_info->cell_id,
+                               cell_info->rac);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_NETWORK_IDENTITY: {
+               const TelNetworkIdentityInfo *identity = data;
+
+               telephony_network_emit_identity(network,
+                               identity->plmn,
+                               identity->short_name,
+                               identity->long_name);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_NETWORK_RSSI: {
+               guint rssi = *(guint *)data;
+
+               /* Update properties */
+               telephony_network_set_rssi(network, rssi);
+               telephony_network_emit_rssi(network, rssi);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_NETWORK_TIMEINFO: {
+               const TelNetworkNitzInfoNoti *time_info = data;
+
+               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->gmtoff,
+                               time_info->isdst,
+                               time_info->dstoff,
+                               time_info->plmn);
+       }
+       break;
+
+       default:
+               err("Unsupported command");
+       }
+
+       return TRUE;
+}
diff --git a/src/dtapi_phonebook.c b/src/dtapi_phonebook.c
new file mode 100644 (file)
index 0000000..04fa8cd
--- /dev/null
@@ -0,0 +1,656 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_phonebook.h"
+#include "dtapi_util.h"
+
+#include <co_phonebook.h>
+#include <plugin.h>
+
+#define AC_PHONEBOOK   "telephony_framework::api_phonebook"
+
+static gboolean __check_phonebook_status(TcorePlugin *plugin)
+{
+       CoreObject *co_pb;
+       gboolean init_status = FALSE;
+
+       co_pb = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
+       tcore_check_return_value(co_pb != NULL, FALSE);
+
+       if (tcore_phonebook_get_status(co_pb, &init_status) == FALSE) {
+               err("Get Status Failed");
+               return FALSE;
+       }
+       tcore_check_return_value(init_status == TRUE, FALSE);
+
+       return TRUE;
+}
+
+static gboolean dtapi_phonebook_get_init_info(TelephonyPhonebook *phonebook,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TcorePlugin *plugin = user_data;
+       gboolean pb_status = FALSE;
+       CoreObject *co_pb = NULL;
+       TelPbList *list = NULL;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
+               return TRUE;
+
+       co_pb = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
+       tcore_check_return_value(co_pb != NULL, TRUE);
+
+       if (tcore_phonebook_get_support_list(co_pb, &list) == FALSE) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Get Support List Failed");
+               return TRUE;
+       }
+       tcore_check_return_value(list != NULL, TRUE);
+
+       dbg("FDN: [%s], ADN: [%s], SDN: [%s], USIM: [%s]",
+               list->fdn ? "TRUE" : "FALSE", list->adn ? "TRUE" : "FALSE",
+               list->sdn ? "TRUE" : "FALSE", list->usim ? "TRUE" : "FALSE");
+
+       if (tcore_phonebook_get_status(co_pb, &pb_status) == FALSE) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Get Status Failed");
+               tcore_free(list);
+               return TRUE;
+       }
+
+       telephony_phonebook_complete_get_init_info(phonebook, invocation,
+               TEL_RETURN_SUCCESS, pb_status,
+               list->fdn, list->adn, list->sdn, list->usim);
+       tcore_free(list);
+
+       return TRUE;
+}
+
+static void on_response_dtapi_phonebook_get_info(gint result,
+               const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       const TelPbInfo *pb_info = response;
+       GVariant *var_info = NULL;
+       GVariantBuilder builder;
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       dbg("Result: [%d]", result);
+
+       g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
+       if (TEL_PB_RESULT_SUCCESS != result || pb_info == NULL) {
+               err("[DBUS]Get Info Response Failed");
+               var_info = g_variant_builder_end(&builder);
+               telephony_phonebook_complete_get_info(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result, -1, var_info);
+               g_variant_unref(var_info);
+
+               tcore_free(rsp_cb_data);
+               return;
+       }
+
+       if (TEL_PB_USIM == pb_info->pb_type) {
+               TelPbUsimInfo *usim = (TelPbUsimInfo *)(&pb_info->info_u.usim);
+
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_count", g_variant_new_uint32(usim->max_count));
+               g_variant_builder_add(&builder, "{sv}",
+                       "used_count", g_variant_new_uint32(usim->used_count));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_num_len", g_variant_new_uint32(usim->max_num_len));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_text_len", g_variant_new_uint32(usim->max_text_len));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_anr_count", g_variant_new_byte(usim->max_anr_count));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_anr_len", g_variant_new_uint32(usim->max_anr_len));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_email_count", g_variant_new_byte(usim->max_email_count));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_email_len", g_variant_new_uint32(usim->max_email_len));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_sne_len", g_variant_new_uint32(usim->max_sne_len));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_gas_count", g_variant_new_uint32(usim->max_gas_count));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_gas_len", g_variant_new_uint32(usim->max_gas_len));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_aas_count", g_variant_new_uint32(usim->max_aas_count));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_aas_len", g_variant_new_uint32(usim->max_aas_len));
+
+               dbg("pb_type: [%d] \n\tmax_count: [%d] used_count: [%d] " \
+                       "max_num_len: [%d] max_text_len: [%d] \n\tmax_anr_count: [%d] " \
+                       "max_anr_len: [%d] max_email_count: [%d] max_email_len: [%d] " \
+                       "max_sne_len: [%d] \n\tmax_gas_count: [%d] max_gas_len: [%d] " \
+                       "max_aas_count: [%d] max_aas_len: [%d]",
+                       pb_info->pb_type,
+                       usim->max_count, usim->used_count,
+                       usim->max_num_len, usim->max_text_len,
+                       usim->max_anr_count, usim->max_anr_len,
+                       usim->max_email_count, usim->max_email_len,
+                       usim->max_sne_len,
+                       usim->max_gas_count, usim->max_gas_len,
+                       usim->max_aas_count, usim->max_aas_len);
+       }
+       else {
+               TelPbSimInfo *sim = (TelPbSimInfo *)(&pb_info->info_u.sim);
+
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_count", g_variant_new_uint32(sim->max_count));
+               g_variant_builder_add(&builder, "{sv}",
+                       "used_count", g_variant_new_uint32(sim->used_count));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_num_len", g_variant_new_uint32(sim->max_num_len));
+               g_variant_builder_add(&builder, "{sv}",
+                       "max_text_len", g_variant_new_uint32(sim->max_text_len));
+
+               dbg("pb_type: [%d] max_count: [%d] used_count: [%d] " \
+                       "max_num_len: [%d] max_text_len: [%d]",
+                       pb_info->pb_type,
+                       sim->max_count, sim->used_count,
+                       sim->max_num_len, sim->max_text_len);
+       }
+       var_info = g_variant_builder_end(&builder);
+
+       telephony_phonebook_complete_get_info(rsp_cb_data->interface_object, rsp_cb_data->invocation,
+                       result, pb_info->pb_type, var_info);
+
+       tcore_free(rsp_cb_data);
+       g_variant_unref(var_info);
+}
+
+static gboolean dtapi_phonebook_get_info(TelephonyPhonebook *phonebook,
+       GDBusMethodInvocation *invocation,
+       gint req_type, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
+               return TRUE;
+
+       if (__check_phonebook_status(plugin) == FALSE) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid Phonebook Status");
+               return TRUE;
+       }
+
+       rsp_cb_data = dtapi_create_resp_cb_data(phonebook, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_PHONEBOOK_GET_INFO,
+               &req_type, sizeof(gint),
+               on_response_dtapi_phonebook_get_info, rsp_cb_data);
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_phonebook_read_record(gint result,
+       const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       const TelPbReadRecord *read_record = response;
+
+       GVariantBuilder read_builder;
+       GVariant *var_read = NULL;
+
+       dbg("Result: [%d]", result);
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       g_variant_builder_init(&read_builder, G_VARIANT_TYPE("a{sv}"));
+       if (TEL_PB_RESULT_SUCCESS == result
+                       && read_record != NULL) {
+               if (read_record->pb_type == TEL_PB_USIM) {
+                       GVariant *var_anr = NULL, *var_email = NULL;
+                       GVariantBuilder anr_builder, email_builder;
+
+                       TelPbUsimRecord *usim = (TelPbUsimRecord *)(&read_record->rec_u.usim);
+                       guint count = 0;
+
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "name", g_variant_new_string(usim->name));
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "number", g_variant_new_string(usim->number));
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "sne", g_variant_new_string(usim->sne));
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "grp_name", g_variant_new_string(usim->grp_name));
+
+                       dbg("Phonebook type: [%d] Name: [%s] Number: [%s] "\
+                               "SNE: [%s] Group Name: [%s]",
+                               read_record->pb_type, usim->name,
+                               usim->number, usim->sne, usim->grp_name);
+
+                       /* ANR */
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "anr_count",  g_variant_new_byte(usim->anr_count));
+                       dbg("ANR Count: [%d]", usim->anr_count);
+
+                       g_variant_builder_init(&anr_builder, G_VARIANT_TYPE("aa{sv}"));
+                       for (count = 0; count < usim->anr_count; count++) {
+                               g_variant_builder_open(&anr_builder, G_VARIANT_TYPE("a{sv}"));
+
+                               g_variant_builder_add(&anr_builder, "{sv}",
+                                       "number",  g_variant_new_string(usim->anr[count].number));
+                               g_variant_builder_add(&anr_builder, "{sv}",
+                                       "description", g_variant_new_boolean(usim->anr[count].description));
+                               g_variant_builder_add(&anr_builder, "{sv}",
+                                       "aas", g_variant_new_string(usim->anr[count].aas));
+
+                               g_variant_builder_close(&anr_builder);
+
+                               dbg("ANR[%d] - Number: [%s] Description: [%s] AAS: [%s]", count,
+                                       usim->anr[count].number,
+                                       usim->anr[count].description ? "YES" : "NO",
+                                       usim->anr[count].aas);
+                       }
+                       var_anr = g_variant_builder_end(&anr_builder);
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "anr", var_anr);
+
+                       /* e-mail */
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "email_count", g_variant_new_byte(usim->email_count));
+                       dbg("e-mail Count: [%d]", usim->email_count);
+                       g_variant_builder_init(&email_builder, G_VARIANT_TYPE("a{sv}"));
+                       if (usim->email_count && usim->email_count <= TEL_PB_EMAIL_MAX_COUNT) {
+                               for (count = 0; count < usim->email_count; count++) {
+                                       char *tmp = g_strdup_printf("%d", count);
+
+                                       dbg("e-mail[%s] - [%s]", tmp, usim->email[count]);
+                                       g_variant_builder_add(&email_builder, "{sv}",
+                                               tmp,
+                                               g_variant_new_from_data(G_VARIANT_TYPE("ay"),
+                                                       usim->email[count], strlen(usim->email[count]),
+                                                       TRUE, NULL, NULL));
+                                       g_free(tmp);
+                               }
+                       }
+                       var_email = g_variant_builder_end(&email_builder);
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "email", var_email);
+
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "hidden", g_variant_new_boolean(usim->hidden));
+                       dbg("Hidden: [%s]", usim->hidden ? "YES" : "NO");
+               }
+               else {
+                       TelPbSimRecord *sim = (TelPbSimRecord *)&(read_record->rec_u.sim);
+
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "name", g_variant_new_string(sim->name));
+                       g_variant_builder_add(&read_builder, "{sv}",
+                               "number", g_variant_new_string(sim->number));
+
+                       dbg("Phonebook type: [%d] Name: [%s] Number: [%s]",
+                               read_record->pb_type, sim->name, sim->number);
+               }
+       }
+       var_read = g_variant_builder_end(&read_builder);
+
+       telephony_phonebook_complete_read_record(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result,
+               read_record->index, read_record->next_index,
+               read_record->pb_type, var_read);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_phonebook_read_record(TelephonyPhonebook *phonebook,
+       GDBusMethodInvocation *invocation,
+       gint req_type, gint index, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn ret;
+       TelPbRecordInfo pb_record;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
+               return TRUE;
+
+       if (__check_phonebook_status(plugin) == FALSE) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid Phonebook Status");
+               return TRUE;
+       }
+
+       pb_record.pb_type = req_type;
+       pb_record.index = index;
+
+       dbg("Phonebook Type: [%d] Index: [%d]", pb_record.pb_type, pb_record.index);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(phonebook, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_PHONEBOOK_READ_RECORD,
+               &pb_record, sizeof(TelPbRecordInfo),
+               on_response_dtapi_phonebook_read_record, rsp_cb_data);
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_phonebook_update_record(gint result,
+       const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+
+       dbg("Result: [%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_phonebook_complete_update_record(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_phonebook_update_record(TelephonyPhonebook *phonebook,
+       GDBusMethodInvocation *invocation,
+       gint pb_type, guint index, GVariant *update_rec,
+       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+
+       TelPbUpdateRecord pb_update;
+       GVariantIter *iter;
+
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_PHONEBOOK, "w") == FALSE)
+               return TRUE;
+
+       if (__check_phonebook_status(plugin) == FALSE) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid Phonebook Status");
+               return TRUE;
+       }
+
+       memset(&pb_update, 0, sizeof(TelPbUpdateRecord));
+
+       pb_update.index = index;
+       pb_update.pb_type = pb_type;
+
+       g_variant_get(update_rec, "a{sv}", &iter);
+       if (pb_update.pb_type == TEL_PB_USIM) {
+               GVariant *key_value;
+               const gchar *key;
+
+               TelPbUsimRecord *usim = (TelPbUsimRecord *)&(pb_update.rec_u.usim);
+
+               while (g_variant_iter_loop(iter, "{sv}", &key, &key_value)) {
+                       if (g_strcmp0(key, "name") == 0) {
+                               g_strlcpy(usim->name,
+                                       g_variant_get_string(key_value, NULL),
+                                       TEL_PB_TEXT_MAX_LEN + 1);
+                       }
+                       else if (g_strcmp0(key, "number") == 0) {
+                               g_strlcpy(usim->number,
+                                       g_variant_get_string(key_value, NULL),
+                                       TEL_PB_NUMBER_MAX_LEN + 1);
+                       }
+                       else if (g_strcmp0(key, "sne") == 0) {
+                               g_strlcpy(usim->sne,
+                                       g_variant_get_string(key_value, NULL),
+                                       TEL_PB_TEXT_MAX_LEN + 1);
+                       }
+                       else if (g_strcmp0(key, "grp_name") == 0) {
+                               g_strlcpy(usim->grp_name,
+                                       g_variant_get_string(key_value, NULL),
+                                       TEL_PB_TEXT_MAX_LEN + 1);
+                       }
+                       else if (g_strcmp0(key, "anr_count") == 0) {
+                               usim->anr_count = g_variant_get_byte(key_value);
+                       }
+                       else if (g_strcmp0(key, "anr") == 0) {
+                               GVariantIter *iter2 = NULL, *iter_row2= NULL;
+                               GVariant *key_value2;
+                               const gchar *key2;
+                               guint count = 0;
+
+                               g_variant_get(key_value, "aa{sv}", &iter2);
+                               while (g_variant_iter_next(iter2, "a{sv}", &iter_row2)) {
+                                       while (g_variant_iter_loop(iter_row2, "{sv}", &key2, &key_value2)) {
+                                               if (g_strcmp0(key2, "number") == 0) {
+                                                       g_strlcpy(usim->anr[count].number,
+                                                               g_variant_get_string(key_value2, NULL),
+                                                               TEL_PB_NUMBER_MAX_LEN + 1);
+                                               }
+                                               else if (g_strcmp0(key2, "description") == 0) {
+                                                       usim->anr[count].description =
+                                                               g_variant_get_boolean(key_value2);
+                                               }
+                                               else if (g_strcmp0(key2, "aas") == 0) {
+                                                       g_strlcpy(usim->anr[count].aas,
+                                                               g_variant_get_string(key_value2, NULL),
+                                                               TEL_PB_TEXT_MAX_LEN + 1);
+                                               }
+                                       }
+                                       g_variant_iter_free(iter_row2);
+                               }
+                               g_variant_iter_free(iter2);
+                       }
+                       else if (g_strcmp0(key, "email_count") == 0) {
+                               usim->email_count = g_variant_get_byte(key_value);
+                       }
+                       else if (g_strcmp0(key, "email") == 0) {
+                               GVariantIter *iter2 = NULL;
+                               GVariant *key_value2;
+                               const gchar *key2;
+                               guint count = 0;
+                               char *tmp;
+
+                               g_variant_get(key_value, "a{sv}", &iter2);
+                               while (g_variant_iter_loop(iter2, "{sv}", &key2, &key_value2)) {
+                                       gconstpointer email;
+
+                                       for (count = 0; count < usim->email_count; count++) {
+                                               tmp = g_strdup_printf("%d", count);
+                                               if (g_strcmp0(key2, tmp) == 0) {
+                                                       email = g_variant_get_data(key_value2);
+                                                       g_strlcpy(usim->email[count], email, strlen(email)+1);
+                                                       dbg("email[%s] - [%s]", tmp, email);
+                                               }
+                                               g_free(tmp);
+                                       }
+                               }
+                               g_variant_iter_free(iter2);
+                       }
+                       else if (g_strcmp0(key, "hidden") == 0) {
+                               usim->hidden = g_variant_get_boolean(key_value);
+                       }
+               }
+       }
+       else {
+               GVariant *key_value;
+               const gchar *key;
+
+               TelPbSimRecord *sim = (TelPbSimRecord *)&(pb_update.rec_u.sim);
+
+               while (g_variant_iter_loop(iter, "{sv}", &key, &key_value)) {
+                       if (g_strcmp0(key, "name") == 0) {
+                               g_strlcpy(sim->name,
+                                       g_variant_get_string(key_value, NULL),
+                                       TEL_PB_TEXT_MAX_LEN + 1);
+                       }
+                       else if (g_strcmp0(key, "number") == 0) {
+                               g_strlcpy(sim->number,
+                                       g_variant_get_string(key_value, NULL),
+                                       TEL_PB_NUMBER_MAX_LEN + 1);
+                       }
+               }
+       }
+       g_variant_iter_free(iter);
+       g_variant_unref(update_rec);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(phonebook, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_PHONEBOOK_UPDATE_RECORD,
+               &pb_update, sizeof(TelPbUpdateRecord),
+               on_response_dtapi_phonebook_update_record, rsp_cb_data);
+       if (TEL_RETURN_SUCCESS != ret) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_phonebook_delete_record(gint result,
+       const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+
+       dbg("Result: [%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_phonebook_complete_delete_record(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_phonebook_delete_record(TelephonyPhonebook *phonebook,
+       GDBusMethodInvocation *invocation,
+       gint pb_type, guint index, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+       TelReturn ret;
+       TelPbRecordInfo pb_record;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_PHONEBOOK, "w") == FALSE)
+               return TRUE;
+
+       if (__check_phonebook_status(plugin) == FALSE) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid Phonebook Status");
+               return TRUE;
+       }
+
+       pb_record.pb_type = pb_type;
+       pb_record.index = index;
+
+       dbg("Phonebook_type: [%d], index: [%d]", pb_record.pb_type, pb_record.index);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(phonebook, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_PHONEBOOK_DELETE_RECORD,
+               &pb_record, sizeof(TelPbRecordInfo),
+               on_response_dtapi_phonebook_delete_record, rsp_cb_data);
+       if (TEL_RETURN_SUCCESS != ret) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_phonebook_interface(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin)
+{
+       TelephonyPhonebook *phonebook = telephony_phonebook_skeleton_new();
+       tcore_check_return_value_assert(phonebook != NULL, FALSE);
+
+       telephony_object_skeleton_set_phonebook(object, phonebook);
+       g_object_unref(phonebook);
+
+       dbg("phonebook = %p", phonebook);
+
+       g_signal_connect(phonebook,
+               "handle-get-init-info",
+               G_CALLBACK(dtapi_phonebook_get_init_info),
+               plugin);
+
+       g_signal_connect(phonebook,
+               "handle-get-info",
+               G_CALLBACK(dtapi_phonebook_get_info),
+               plugin);
+
+       g_signal_connect(phonebook,
+               "handle-read-record",
+               G_CALLBACK(dtapi_phonebook_read_record),
+               plugin);
+
+       g_signal_connect(phonebook,
+               "handle-update-record",
+               G_CALLBACK(dtapi_phonebook_update_record),
+               plugin);
+
+       g_signal_connect(phonebook,
+               "handle-delete-record",
+               G_CALLBACK(dtapi_phonebook_delete_record),
+               plugin);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_phonebook_notification(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin, TcoreNotification command,
+       guint data_len, const void *data)
+{
+       TelephonyPhonebook *phonebook;
+
+       tcore_check_return_value_assert(object != NULL, FALSE);
+       tcore_check_return_value_assert(plugin != NULL, FALSE);
+       tcore_check_return_value_assert(data != NULL, FALSE);
+
+       phonebook = telephony_object_peek_phonebook(TELEPHONY_OBJECT(object));
+
+       tcore_check_return_value_assert(phonebook != NULL, FALSE);
+
+       switch (command) {
+       case TCORE_NOTIFICATION_PHONEBOOK_STATUS: {
+               const TelPbInitInfo *init_info = data;
+               dbg("Phonebook: [%p], init_status: [%d], "
+                       "FDN: [%d], ADN: [%d], SDN: [%d], USIM: [%d]",
+                       phonebook, init_info->init_status,
+                       init_info->pb_list.fdn, init_info->pb_list.adn,
+                       init_info->pb_list.sdn, init_info->pb_list.usim);
+
+               telephony_phonebook_emit_status(phonebook, init_info->init_status,
+                       init_info->pb_list.fdn, init_info->pb_list.adn,
+                       init_info->pb_list.sdn, init_info->pb_list.usim);
+       }
+       break;
+
+       default:
+               err("not handled cmd[0x%x]", command);
+       }
+
+       return TRUE;
+}
diff --git a/src/dtapi_sap.c b/src/dtapi_sap.c
new file mode 100644 (file)
index 0000000..03460bd
--- /dev/null
@@ -0,0 +1,405 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_sap.h"
+#include "dtapi_util.h"
+
+#include <plugin.h>
+#include <tel_sap.h>
+
+#define AC_SAP         "telephony_framework::api_sap"
+
+static void on_response_dtapi_sap_req_connect(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       guint max_msg_size = 0;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+       tcore_check_return_assert(NULL != response);
+
+       if (result == TEL_SAP_RESULT_SUCCESS)
+               max_msg_size = *(guint *)response;
+
+       dbg("result = [%d], resp_max_size[%d]", result, max_msg_size);
+
+       telephony_sap_complete_req_connect(rsp_cb_data->interface_object, rsp_cb_data->invocation,
+                                                                          result, max_msg_size);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sap_req_connect(TelephonySap *sap, GDBusMethodInvocation *invocation,
+                       guint req_max_size, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAP, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sap, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SAP_REQ_CONNECT, &req_max_size,
+                               sizeof(req_max_size), on_response_dtapi_sap_req_connect, rsp_cb_data);
+
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sap_req_disconnect(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result = [%d]", result);
+
+       telephony_sap_complete_req_disconnect(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sap_req_disconnect(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAP, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sap, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SAP_REQ_DISCONNECT, NULL, 0,
+                               on_response_dtapi_sap_req_disconnect, rsp_cb_data);
+
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sap_get_atr(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       const TelSapAtr *sap_atr = response;
+       gchar *encoded_atr = NULL;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+       tcore_check_return_assert(NULL != sap_atr);
+       tcore_check_return_assert(sap_atr->atr_len <= TEL_SAP_ATR_LEN_MAX);
+
+       dbg("result = [%d]", result);
+
+       if (result == TEL_SAP_RESULT_SUCCESS) {
+               encoded_atr = g_base64_encode(sap_atr->atr, sap_atr->atr_len);
+               dbg("encoded_atr: [%s] encoded_atr_len: [%d]", encoded_atr, strlen(encoded_atr));
+       }
+
+       telephony_sap_complete_get_atr(rsp_cb_data->interface_object, rsp_cb_data->invocation,
+                                                                  result, encoded_atr);
+       tcore_free(encoded_atr);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sap_get_atr(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAP, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sap, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SAP_GET_ATR, NULL, 0,
+                                       on_response_dtapi_sap_get_atr, rsp_cb_data);
+
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sap_req_transfer_apdu(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       const TelSapApduResp *resp_apdu = response;
+       gchar *encoded_apdu = NULL;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+       tcore_check_return_assert(NULL != resp_apdu);
+       tcore_check_return_assert(resp_apdu->apdu_resp_len  <= TEL_SAP_APDU_RESP_LEN_MAX);
+
+       dbg("result = [%d]", result);
+
+       if (result == TEL_SAP_RESULT_SUCCESS) {
+               encoded_apdu = g_base64_encode(resp_apdu->apdu_resp, resp_apdu->apdu_resp_len);
+               dbg("encoded_apdu: [%s] encoded_apdu_len: [%d]", encoded_apdu, strlen(encoded_apdu));
+       }
+
+       telephony_sap_complete_req_transfer_apdu(rsp_cb_data->interface_object, rsp_cb_data->invocation,
+                                                                  result, encoded_apdu);
+       tcore_free(encoded_apdu);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sap_req_transfer_apdu(TelephonySap *sap, GDBusMethodInvocation *invocation,
+                                                               gchar *apdu, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+       TelSapApdu req_apdu;
+       guchar *decoded_apdu = NULL;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAP, "x") == FALSE)
+               return TRUE;
+
+       memset(&req_apdu, 0, sizeof(TelSapApdu));
+
+       decoded_apdu = g_base64_decode(apdu, &req_apdu.apdu_len);
+       if ((decoded_apdu != NULL) && (req_apdu.apdu_len <= TEL_SAP_APDU_LEN_MAX)) {
+               memcpy(req_apdu.apdu, decoded_apdu, req_apdu.apdu_len);
+       } else {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Decoding APDU request failed");
+               tcore_free(decoded_apdu);
+               return TRUE;
+       }
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sap, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SAP_REQ_TRANSFER_APDU,
+                       &req_apdu, sizeof(TelSapApdu), on_response_dtapi_sap_req_transfer_apdu, rsp_cb_data);
+
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+       tcore_free(decoded_apdu);
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sap_req_transport_protocol(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result = [%d]", result);
+
+       telephony_sap_complete_req_transport_protocol(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sap_req_transport_protocol(TelephonySap *sap, GDBusMethodInvocation *invocation,
+                                                       gint req_protocol, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+       TelSimSapProtocol sap_protocoal;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAP, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sap, invocation, NULL, 0);
+
+       sap_protocoal = req_protocol;
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SAP_REQ_TRANSPORT_PROTOCOL,
+                       &sap_protocoal, sizeof(TelSimSapProtocol), on_response_dtapi_sap_req_transport_protocol, rsp_cb_data);
+
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sap_req_power_operation(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result = [%d]", result);
+
+       telephony_sap_complete_req_power_operation(rsp_cb_data->interface_object, rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sap_req_power_operation(TelephonySap *sap, GDBusMethodInvocation *invocation,
+                                               gint req_power_mode, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+       TelSapPowerMode sap_power_mode;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAP, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sap, invocation, NULL, 0);
+
+       sap_power_mode = req_power_mode;
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SAP_REQ_POWER_OPERATION,
+                       &sap_power_mode, sizeof(TelSapPowerMode), on_response_dtapi_sap_req_power_operation, rsp_cb_data);
+
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sap_get_card_reader_status(gint result, const void *response, void *user_data)
+{
+       DbusRespCbData *rsp_cb_data = user_data;
+       gint sap_status = 0;
+       tcore_check_return_assert(NULL != rsp_cb_data);
+       tcore_check_return_assert(NULL != response);
+
+       if(result == TEL_SAP_RESULT_SUCCESS)
+               sap_status = *(gint *)response;
+
+       dbg("result = [%d] sap status = [%d]", result,  sap_status);
+
+       telephony_sap_complete_get_card_reader_status(rsp_cb_data->interface_object, rsp_cb_data->invocation,
+                                                                       result, sap_status);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sap_get_card_reader_status(TelephonySap *sap, GDBusMethodInvocation *invocation,
+                                       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data;
+       TcorePlugin *plugin = (TcorePlugin *)user_data;
+       TelReturn ret;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAP, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sap, invocation, NULL, 0);
+
+       ret = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SAP_GET_CARDREADER_STATUS, NULL, 0,
+                                       on_response_dtapi_sap_get_card_reader_status, rsp_cb_data);
+
+       if (ret != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_sap_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin)
+{
+       TelephonySap *sap = telephony_sap_skeleton_new();
+       tcore_check_return_value_assert(NULL != sap, FALSE);
+
+       telephony_object_skeleton_set_sap(object, sap);
+       g_object_unref(sap);
+
+       dbg("sap = %p", sap);
+
+       g_signal_connect (sap,
+                       "handle-req-connect",
+                       G_CALLBACK (dtapi_sap_req_connect),
+                       plugin);
+
+       g_signal_connect (sap,
+                       "handle-req-disconnect",
+                       G_CALLBACK (dtapi_sap_req_disconnect),
+                       plugin);
+
+       g_signal_connect (sap,
+                       "handle-get-atr",
+                       G_CALLBACK (dtapi_sap_get_atr),
+                       plugin);
+
+       g_signal_connect (sap,
+                       "handle-req-transfer-apdu",
+                       G_CALLBACK (dtapi_sap_req_transfer_apdu),
+                       plugin);
+
+       g_signal_connect (sap,
+                       "handle-req-transport-protocol",
+                       G_CALLBACK (dtapi_sap_req_transport_protocol),
+                       plugin);
+
+       g_signal_connect (sap,
+                       "handle-req-power-operation",
+                       G_CALLBACK (dtapi_sap_req_power_operation),
+                       plugin);
+
+       g_signal_connect (sap,
+                       "handle-get-card-reader-status",
+                       G_CALLBACK (dtapi_sap_get_card_reader_status),
+                       plugin);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_sap_notification(TelephonyObjectSkeleton *object, TcorePlugin *plugin,
+       TcoreNotification command, guint data_len, const void *data)
+{
+       TelephonySap *sap;
+
+       tcore_check_return_value_assert(NULL != object, FALSE);
+       tcore_check_return_value_assert(NULL != data, FALSE);
+       sap = telephony_object_peek_sap(TELEPHONY_OBJECT(object));
+
+       switch (command) {
+       case TCORE_NOTIFICATION_SAP_STATUS:
+       {
+               int sap_status = *(int *)data;
+               dbg("sap(%p) : sap_status = [%d]", sap, sap_status);
+               telephony_sap_emit_status(sap, sap_status);
+       }
+       break;
+       default:
+               err("not handled command[0x%x]", command);
+       break;
+       }
+       return TRUE;
+}
diff --git a/src/dtapi_sat.c b/src/dtapi_sat.c
new file mode 100644 (file)
index 0000000..e787138
--- /dev/null
@@ -0,0 +1,1385 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_sat.h"
+//#include "dtapi_util.h"
+#include "plugin.h"
+#include "sat-manager/include/sat_manager.h"
+#include "sat-manager/include/sat_ui_support.h"
+
+#define AC_SAT "telephony_framework::api_sat"
+
+static void _util_sat_set_main_menu(DtapiSatPrivateData *sat_data,
+       const char *cp_name, GVariant *main_menu)
+{
+       GSList *list = NULL;
+       SatCachedData *object = NULL;
+
+       for (list = sat_data->cached_data; list; list = list->next) {
+               object = (SatCachedData *) list->data;
+               if (object == NULL)
+                       continue;
+
+               if (g_strcmp0(object->cp_name, cp_name) == 0 ) {
+                       /* need to free the previous main_menu */
+                       g_variant_unref(object->cached_sat_main_menu);
+                       object->cached_sat_main_menu = main_menu;
+                       return;
+               }
+       }
+
+       /* If 'object' is NOT created, then create the object and add to the list */
+       object = tcore_try_malloc0(sizeof(SatCachedData));
+       if (NULL == object) {
+               err(" Malloc Failed");
+               return;
+       }
+       object->cp_name = g_strdup(cp_name);
+       object->cached_sat_main_menu = main_menu;
+
+       sat_data->cached_data =
+               g_slist_append(sat_data->cached_data, (gpointer)object);
+}
+
+static GVariant *_util_sat_get_main_menu(DtapiSatPrivateData *sat_data,
+       const char *cp_name)
+{
+       GSList *list = NULL;
+       SatCachedData *object;
+
+       dbg("Get Main menu");
+       /*
+        * List of Objects in 'sat_data',
+        * compare cp_name with modem_name stored in 'sat_data'
+        * if matching return main_menu of that object.
+        */
+       for (list = sat_data->cached_data; list; list = list->next) {
+               object = (SatCachedData *)list->data;
+               if (object == NULL)
+                       continue;
+
+               if (g_strcmp0(object->cp_name, cp_name) == 0)
+                       return object->cached_sat_main_menu;
+       }
+
+       return NULL;
+}
+
+static gboolean dtapi_sat_get_main_menu_info(TelephonySat *sat,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DtapiSatPluginsInfo *plugins_info = (DtapiSatPluginsInfo *)user_data;
+       TcorePlugin *comm_plugin = plugins_info->comm_plugin;
+       GVariant *main_menu = NULL;
+       DtapiSatPrivateData *sat_data = NULL;
+       gchar *title;
+       gint command_id, item_cnt;
+       gboolean is_present, is_help_info, is_updated;
+       GVariant *items;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAT, "r") == FALSE)
+               return TRUE;
+
+       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+       if (!sat_data) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid parameter");
+               return TRUE;
+       }
+
+       main_menu = _util_sat_get_main_menu(sat_data,
+               dtapi_get_cp_name_by_object_path(
+                       g_dbus_method_invocation_get_object_path(invocation)));
+       if (!main_menu) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "No main menu");
+               return TRUE;
+       }
+
+       g_variant_get(main_menu, "(ibs@vibb)",
+               &command_id, &is_present, &title, &items, &item_cnt,
+               &is_help_info, &is_updated);
+
+       dbg("Command ID: [%d] Menu: [%s] Title: [%s] count: [%d]",
+               command_id, is_present ? "PRESENT" : "NOT PRESENT",
+               title, item_cnt);
+
+       telephony_sat_complete_get_main_menu_info(sat, invocation,
+               TEL_SAT_RESULT_SUCCESS, command_id, is_present, title, items, item_cnt,
+               is_help_info, is_updated);
+
+       return TRUE;
+}
+
+static gboolean dtapi_sat_send_display_status(TelephonySat *sat,
+       GDBusMethodInvocation *invocation, gint arg_command_id,
+       gboolean arg_display_status, gpointer user_data)
+{
+       DtapiSatPluginsInfo *plugins_info = (DtapiSatPluginsInfo *)user_data;
+       gboolean result = FALSE;
+       gint out_param = 1;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAT, "x") == FALSE)
+               return TRUE;
+
+       result = sat_manager_handle_ui_display_status(plugins_info,
+               arg_command_id, arg_display_status);
+       if (!result) {
+               err("fail to send display status");
+       }
+
+       out_param = (result ? 1 : 0);
+       telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
+
+       return TRUE;
+}
+
+static gboolean dtapi_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)
+{
+       DtapiSatPluginsInfo *plugins_info = (DtapiSatPluginsInfo *)user_data;
+       gboolean result = FALSE;
+       gint out_param = 1;
+       GVariant *confirm_data = NULL;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAT, "x") == FALSE)
+               return TRUE;
+
+       confirm_data = g_variant_new("(iiv)",
+               arg_command_id, arg_user_confirm_type, arg_additional_data);
+
+       result = sat_manager_handle_user_confirm(plugins_info, confirm_data);
+       if (!result) {
+               err("fail to send user confirm");
+       }
+
+       out_param = (result ? 1 : 0);
+       telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
+
+       return TRUE;
+}
+
+static gboolean dtapi_sat_send_app_exec_result(TelephonySat *sat,
+       GDBusMethodInvocation *invocation, gint arg_command_id,
+       gint arg_command_type, GVariant *arg_exec_result,
+       gpointer user_data)
+{
+       DtapiSatPluginsInfo *plugins_info = (DtapiSatPluginsInfo *)user_data;
+       TcorePlugin *plugin = plugins_info->plugin;
+       gboolean result = FALSE;
+       gint out_param = 1;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAT, "x") == FALSE)
+               return TRUE;
+
+       dbg("processing app exec result");
+       result = sat_manager_handle_app_exec_result(plugin,
+               arg_command_id, arg_command_type, arg_exec_result);
+       if (!result) {
+               err("fail to send exec result");
+       }
+
+       out_param = (result ? 1 : 0);
+       telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sat_select_menu(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = (DbusRespCbData *)cb_data;
+       TelSatEnvelopeResp *envelop_resp = (TelSatEnvelopeResp *)data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("Select Menu Envelope Response: Result:[%d] Env Resp:[%d]", result, *envelop_resp);
+       telephony_sat_complete_select_menu(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, (gint)*envelop_resp);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sat_select_menu(TelephonySat *sat,
+       GDBusMethodInvocation *invocation, guchar arg_item_identifier,
+       gboolean arg_help_request, gpointer user_data)
+{
+       DtapiSatPluginsInfo *plugins_info = (DtapiSatPluginsInfo *)user_data;
+       TcorePlugin *plugin = plugins_info->plugin;
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelSatRequestEnvelopCmdData envelop_req;
+       TelReturn result;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAT, "x") == FALSE)
+               return TRUE;
+
+       memset(&envelop_req, 0, sizeof(TelSatRequestEnvelopCmdData));
+
+       envelop_req.sub_cmd = TEL_SAT_ENVELOP_MENU_SELECTION;
+       envelop_req.envelop_data.menu_select.device_identitie.src = TEL_SAT_DEVICE_ID_KEYPAD;
+       envelop_req.envelop_data.menu_select.device_identitie.dest = TEL_SAT_DEVICE_ID_SIM;
+       envelop_req.envelop_data.menu_select.item_identifier = arg_item_identifier;
+       envelop_req.envelop_data.menu_select.help_request = arg_help_request;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sat, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SAT_REQ_ENVELOPE,
+               &envelop_req, sizeof(TelSatRequestEnvelopCmdData),
+               on_response_dtapi_sat_select_menu, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Request dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sat_download_event(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       TelSatEnvelopeResp *envelop_resp = (TelSatEnvelopeResp *)data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("Event Download Envelope Response: Result:[%d] Env Resp:[%d]", result, *envelop_resp);
+       telephony_sat_complete_download_event(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, (gint)*envelop_resp);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_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)
+{
+       DtapiSatPluginsInfo *plugins_info = (DtapiSatPluginsInfo *)user_data;
+       TcorePlugin *plugin = plugins_info->plugin;
+       DbusRespCbData *rsp_cb_data = NULL;
+       TelSatRequestEnvelopCmdData envelop_req;
+       TelReturn result;
+
+       dbg("Entry");
+
+       if (dtapi_check_access_control(invocation, AC_SAT, "x") == FALSE)
+               return TRUE;
+
+       memset(&envelop_req, 0, sizeof(TelSatRequestEnvelopCmdData));
+
+       envelop_req.sub_cmd = TEL_SAT_ENVELOP_EVENT_DOWNLOAD;
+       envelop_req.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_req.envelop_data.event_download,
+               arg_download_data);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sat, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SAT_REQ_ENVELOPE,
+               &envelop_req, sizeof(TelSatRequestEnvelopCmdData),
+               on_response_dtapi_sat_download_event, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Request dispatch failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_sat_interface(TelephonyObjectSkeleton *object, TcorePlugin *plugin, TcorePlugin *comm_plugin)
+{
+       TelephonySat *sat;
+       DtapiSatPluginsInfo *plugins_info;
+
+       sat = telephony_sat_skeleton_new();
+       telephony_object_skeleton_set_sat(object, sat);
+       g_object_unref(sat);
+
+       dbg("sat = %p", sat);
+
+       plugins_info = tcore_malloc0(sizeof(DtapiSatPluginsInfo));
+       plugins_info->comm_plugin = comm_plugin;
+       plugins_info->plugin = plugin;
+
+       g_signal_connect (sat,
+                       "handle-get-main-menu-info",
+                       G_CALLBACK (dtapi_sat_get_main_menu_info),
+                       plugins_info);
+
+       g_signal_connect (sat,
+                       "handle-send-ui-display-status",
+                       G_CALLBACK (dtapi_sat_send_display_status),
+                       plugins_info);
+
+       g_signal_connect (sat,
+                       "handle-send-user-confirm",
+                       G_CALLBACK (dtapi_sat_send_user_confirm),
+                       plugins_info);
+
+       g_signal_connect (sat,
+                       "handle-send-app-exec-result",
+                       G_CALLBACK (dtapi_sat_send_app_exec_result),
+                       plugins_info);
+
+       g_signal_connect (sat,
+                       "handle-select-menu",
+                       G_CALLBACK (dtapi_sat_select_menu),
+                       plugins_info);
+
+       g_signal_connect (sat,
+                       "handle-download-event",
+                       G_CALLBACK (dtapi_sat_download_event),
+                       plugins_info);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_sat_notification(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin, TcorePlugin *comm_plugin, TcoreNotification command,
+       guint data_len, const void *data)
+{
+       TelephonySat *sat;
+       const char *cp_name;
+       DtapiSatPrivateData *sat_data = NULL;
+
+       if (!object || !plugin) {
+               err("Invalid parameters");
+               return FALSE;
+       }
+       cp_name  = tcore_server_get_cp_name_by_plugin(plugin);
+
+       dbg("Notification!!! Command: [0x%x] CP Name: [%s]", command, cp_name);
+
+       sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+       dbg("sat: [%p]", sat);
+
+       sat_data = (DtapiSatPrivateData *)tcore_plugin_ref_user_data(comm_plugin);
+       if (!sat_data) {
+               err("sat_data is null");
+               return FALSE;
+       }
+
+       /* SAT UI storage init */
+       sat_ui_support_storage_init(sat_data->server);
+
+       //session end notification
+       switch (command) {
+               case TCORE_NOTIFICATION_SAT_SESSION_END: {
+                       dbg("notified sat session end evt");
+                       sat_manager_init_queue();
+
+                       //sat_ui_support_terminate_sat_ui();
+                       telephony_sat_emit_end_proactive_session(sat,
+                               TEL_SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
+
+                       return TRUE;
+               }
+               break;
+
+               //call control notification
+               case TCORE_NOTIFICATION_SAT_CALL_CTRL_RESULT: {
+                       TelSatNotiCallControlResultInd *cc_result_noti = NULL;
+                       gint call_ctrl_result = 0, bc_repeat_indicator = 0, ton = 0x0F, npi=0X0F;
+                       gchar *text = NULL, *call_num = NULL, *ss_string = NULL;
+                       gchar *sub_addr = NULL, *ccp1 = NULL, *ccp2 = NULL;
+
+                       cc_result_noti = (TelSatNotiCallControlResultInd *)data;
+                       if (NULL == cc_result_noti) {
+                               err("Indication data is NULL");
+                               return FALSE;
+                       }
+                       dbg("sat call control result notification");
+
+                       call_ctrl_result = cc_result_noti->cc_result;
+                       bc_repeat_indicator = cc_result_noti->bc_repeat_type;
+
+                       if (cc_result_noti->address.dialing_number_len > 0) {
+                               ton = cc_result_noti->address.ton;
+                               npi = cc_result_noti->address.npi;
+                               call_num = g_strdup(cc_result_noti->address.dialing_number);
+                               ss_string = g_strdup("");
+                       }
+                       else if (cc_result_noti->ss_string.string_len > 0) {
+                               ton = cc_result_noti->ss_string.ton;
+                               npi = cc_result_noti->ss_string.npi;
+                               call_num = g_strdup("");
+                               ss_string = g_strdup(cc_result_noti->ss_string.ss_string);
+                       }
+
+                       if (cc_result_noti->alpha_id.alpha_data_len > 0) {
+                               text = g_strdup(cc_result_noti->alpha_id.alpha_data);
+                       }
+                       else{
+                               text = g_strdup("");
+                       }
+
+                       if (cc_result_noti->sub_address.subaddress_len > 0) {
+                               sub_addr = g_strdup(cc_result_noti->sub_address.subaddress);
+                       }
+                       else{
+                               sub_addr = g_strdup("");
+                       }
+
+                       if (cc_result_noti->ccp1.data_len > 0) {
+                               ccp1 = g_strdup(cc_result_noti->ccp1.data);
+                       }
+                       else{
+                               ccp1 = g_strdup("");
+                       }
+
+
+                       if (cc_result_noti->ccp2.data_len > 0) {
+                               ccp2 = g_strdup(cc_result_noti->ccp2.data);
+                       }
+                       else{
+                               ccp2 = g_strdup("");
+                       }
+
+#if 0                  /* TODO - unblock */
+                       telephony_sat_emit_call_control_result(sat, call_ctrl_result, text, ton, npi, call_num,
+                               ss_string, sub_addr, ccp1, ccp2, bc_repeat_indicator);
+#endif
+                       g_free(text); g_free(call_num); g_free(ss_string);
+                       g_free(sub_addr); g_free(ccp1); g_free(ccp2);
+                       return TRUE;
+               }
+               break;
+
+               case TCORE_NOTIFICATION_SAT_MO_SM_CTRL_RESULT: {
+                       TelSatNotiMoSmControlResultInd *mo_sm_result_noti = NULL;
+                       gint call_ctrl_result = 0;
+                       gint rp_dst_ton = 0x0F, rp_dst_npi = 0X0F, tp_dst_ton = 0x0F, tp_dst_npi = 0X0F;
+                       gchar *text = NULL, *rp_dst_call_num = NULL, *tp_dst_call_num = NULL;
+
+                       mo_sm_result_noti = (TelSatNotiMoSmControlResultInd *)data;
+                       if (mo_sm_result_noti == NULL) {
+                               err("Indication data is NULL");
+                               return FALSE;
+                       }
+                       dbg("sat mo sm control result notification");
+
+                       call_ctrl_result = mo_sm_result_noti->cc_result;
+
+                       if (mo_sm_result_noti->rp_dst_address.dialing_number_len > 0) {
+                               rp_dst_ton = mo_sm_result_noti->rp_dst_address.ton;
+                               rp_dst_npi = mo_sm_result_noti->rp_dst_address.npi;
+                               rp_dst_call_num = g_strdup(mo_sm_result_noti->rp_dst_address.dialing_number);
+                       } else {
+                               rp_dst_call_num = g_strdup("");
+                       }
+
+                       if (mo_sm_result_noti->tp_dst_address.dialing_number_len > 0) {
+                               tp_dst_ton = mo_sm_result_noti->tp_dst_address.ton;
+                               tp_dst_npi = mo_sm_result_noti->tp_dst_address.npi;
+                               tp_dst_call_num = g_strdup(mo_sm_result_noti->tp_dst_address.dialing_number);
+                       } else {
+                               tp_dst_call_num = g_strdup("");
+                       }
+
+                       if (mo_sm_result_noti->alpha_id.alpha_data_len > 0) {
+                               text = g_strdup(mo_sm_result_noti->alpha_id.alpha_data);
+                       }
+                       else{
+                               text = g_strdup("");
+                       }
+
+#if 0                  /* TODO - unblock */
+                       telephony_sat_emit_mo_sm_control_result(sat, call_ctrl_result, text,
+                               rp_dst_ton, rp_dst_npi, rp_dst_call_num, tp_dst_ton, tp_dst_npi, tp_dst_call_num);
+#endif
+                       g_free(text); g_free(rp_dst_call_num); g_free(tp_dst_call_num);
+                       return TRUE;
+               }
+               break;
+
+               //Proactive Command Notification
+               case TCORE_NOTIFICATION_SAT_PROACTIVE_CMD: {
+                       TelSatNotiProactiveData *p_ind;
+
+                       if (cp_name == NULL) {
+                               err("CP name is NULL");
+                               return FALSE;
+                       }
+
+                       p_ind = (TelSatNotiProactiveData *)data;
+                       if (p_ind == NULL) {
+                               err("Indication data is NULL");
+                               return FALSE;
+                       }
+                       dbg("notified sat proactive command(%d)", p_ind->cmd_type);
+
+                       switch (p_ind->cmd_type) {
+                               case TEL_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 is_present, is_helpinfo, is_updated;
+                                       GVariant *items;
+
+                                       menu_info = sat_manager_extracting_setup_menu_info(plugin, comm_plugin, (TelSatSetupMenuTlv*)&p_ind->proactive_ind_data.setup_menu);
+
+                                       if (!menu_info) {
+                                               err("no main menu data");
+                                               sat_ui_support_remove_desktop_file();
+                                               telephony_sat_emit_end_proactive_session(sat, TEL_SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
+                                               return TRUE;
+                                       }
+
+                                       _util_sat_set_main_menu(sat_data, cp_name, menu_info);
+
+                                       dbg("menu_info type_format(%s)", g_variant_get_type_string(menu_info));
+                                       g_variant_get(menu_info, "(ibs@vibb)", &command_id, &is_present, &title, &items,
+                                                       &menu_cnt, &is_helpinfo, &is_updated);
+
+                                       rv = sat_ui_support_create_desktop_file(title);
+
+                                       dbg("return value (%d)", rv);
+                                       if (rv)
+                                               resp = g_variant_new("(i)", TEL_SAT_RESULT_SUCCESS);
+                                       else
+                                               resp = g_variant_new("(i)", TEL_SAT_RESULT_ME_UNABLE_TO_PROCESS_COMMAND);
+
+                                       exec_result = g_variant_new_variant(resp);
+                                       sat_manager_handle_app_exec_result(plugin, command_id, TEL_SAT_PROATV_CMD_SETUP_MENU, exec_result);
+
+                                       //sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SETUP_MENU, menu_info);
+                                       if (is_updated)
+                                               telephony_sat_emit_setup_menu(sat, command_id, is_present, title, items, menu_cnt,
+                                                       is_helpinfo, is_updated);
+                               }
+                               break;
+
+                               case TEL_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;
+                                       GVariant *icon_id = NULL;
+                                       int ret;
+
+                                       display_text = sat_manager_display_text_noti(plugin, (TelSatDisplayTextTlv*) &p_ind->proactive_ind_data.display_text, p_ind->decode_err_code);
+
+                                       if (!display_text) {
+                                               err("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);
+
+                                       ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_DISPLAY_TEXT, display_text);
+                                       if (!ret) {
+                                               int rv;
+                                               err("fail to launch sat-ui, remove the queued data!!\n");
+                                               if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                       err("Fail to send terminal response\n");
+                                               rv = sat_manager_remove_cmd_by_id(command_id);
+                                               if (!rv)
+                                                       err("fail to dequeue data\n");
+                                       }
+
+                                       telephony_sat_emit_display_text(sat, command_id, text, text_len, duration,
+                                                       high_priority, user_rsp_required, immediately_rsp);
+
+                               }
+                               break;
+
+                               case TEL_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;
+                                       int ret;
+
+                                       select_menu = sat_manager_select_item_noti(plugin, (TelSatSelectItemTlv*) &p_ind->proactive_ind_data.select_item, p_ind->decode_err_code);
+
+                                       if (!select_menu) {
+                                               err("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);
+
+                                       ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_SELECT_ITEM, select_menu);
+                                       if (!ret) {
+                                               int rv;
+                                               err("fail to launch sat-ui, remove the queued data!!\n");
+                                               if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                       err("Fail to send terminal response\n");
+                                               rv = sat_manager_remove_cmd_by_id(command_id);
+                                               if (!rv)
+                                                       err("fail to dequeue data\n");
+                                       }
+
+                                       telephony_sat_emit_select_item (sat, command_id, help_info, selected_text, text_len,
+                                                       default_item_id, menu_cnt, menu_items);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_GET_INKEY:{
+                                       GVariant *get_inkey = NULL;
+                                       gint command_id, key_type, input_character_mode;
+                                       gint text_len, duration;
+                                       gboolean is_numeric, is_help_info;
+                                       gchar *text;
+                                       GVariant *icon_id;
+                                       int ret;
+
+                                       get_inkey = sat_manager_get_inkey_noti(plugin, (TelSatGetInkeyTlv*) &p_ind->proactive_ind_data.get_inkey, p_ind->decode_err_code);
+
+                                       if (!get_inkey) {
+                                               err("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,
+                                                       &is_numeric,&is_help_info, &text, &text_len, &duration, &icon_id);
+
+                                       ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_GET_INKEY, get_inkey);
+                                       if (!ret) {
+                                               int rv;
+                                               err("fail to launch sat-ui, remove the queued data!!\n");
+                                               if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                       err("Fail to send terminal response\n");
+                                               rv = sat_manager_remove_cmd_by_id(command_id);
+                                               if (!rv)
+                                                       err("fail to dequeue data\n");
+                                       }
+
+                                       telephony_sat_emit_get_inkey(sat, command_id, key_type, input_character_mode,
+                                                       is_numeric, is_help_info, text, text_len, duration);
+                               }
+                               break;
+
+                               case TEL_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 is_numeric, is_help_info, is_echo_input;
+                                       gchar *text, *def_text;
+                                       GVariant *icon_id;
+                                       int ret;
+
+                                       get_input = sat_manager_get_input_noti(plugin, (TelSatGetInputTlv*) &p_ind->proactive_ind_data.get_input, p_ind->decode_err_code);
+
+                                       if (!get_input) {
+                                               err("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, &is_numeric, &is_help_info, &is_echo_input,
+                                                       &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len, &icon_id);
+
+                                       ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_GET_INPUT, get_input);
+                                       if (!ret) {
+                                               int rv;
+                                               err("fail to launch sat-ui, remove the queued data!!\n");
+                                               if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                       err("Fail to send terminal response\n");
+                                               rv = sat_manager_remove_cmd_by_id(command_id);
+                                               if (!rv)
+                                                       err("fail to dequeue data\n");
+                                       }
+
+                                       telephony_sat_emit_get_input(sat, command_id, input_character_mode, is_numeric, is_help_info,
+                                                       is_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_PLAY_TONE:{
+                                       GVariant *play_tone = NULL;
+                                       gint command_id, tone_type, duration;
+                                       gint text_len;
+                                       gchar* text;
+                                       GVariant *icon_id;
+                                       int ret;
+
+                                       play_tone = sat_manager_play_tone_noti(plugin, (TelSatPlayToneTlv*) &p_ind->proactive_ind_data.play_tone);
+
+                                       if (!play_tone) {
+                                               err("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);
+
+                                       ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_PLAY_TONE, play_tone);
+                                       if (!ret) {
+                                               int rv;
+                                               err("fail to launch sat-ui, remove the queued data!!\n");
+                                               if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                       err("Fail to send terminal response\n");
+                                               rv = sat_manager_remove_cmd_by_id(command_id);
+                                               if (!rv)
+                                                       err("fail to dequeue data\n");
+                                       }
+
+                                       telephony_sat_emit_play_tone(sat, command_id, text, text_len, tone_type, duration);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_SEND_SMS:{
+                                       GVariant *send_sms = NULL;
+
+                                       gint command_id, ton, npi, tpdu_type;
+                                       gboolean is_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(plugin, (TelSatSendSmsTlv*) &p_ind->proactive_ind_data.send_sms);
+
+                                       if (!send_sms) {
+                                               err("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, &is_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;
+                                               int ret;
+                                               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);
+                                               ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_NONE, ui_info);
+                                               if (!ret) {
+                                                       int rv;
+                                                       err("fail to launch sat-ui, remove the queued data!!\n");
+                                                       if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                               err("Fail to send terminal response\n");
+                                                       rv = sat_manager_remove_cmd_by_id(command_id);
+                                                       if (!rv)
+                                                               err("fail to dequeue data\n");
+                                               }
+                                               return TRUE;
+                                       }
+                                       telephony_sat_emit_send_sms(sat, command_id, text, text_len, is_packing_required,
+                                                       ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
+                               }
+                               break;
+
+                               case TEL_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(plugin, (TelSatSendSsTlv*) &p_ind->proactive_ind_data.send_ss);
+
+                                       if (!send_ss) {
+                                               err("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;
+                                               int ret;
+                                               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);
+                                               ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_NONE, ui_info);
+                                               if (!ret) {
+                                                       int rv;
+                                                       err("fail to launch sat-ui, remove the queued data!!\n");
+                                                       if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                               err("Fail to send terminal response\n");
+                                                       rv = sat_manager_remove_cmd_by_id(command_id);
+                                                       if (!rv)
+                                                               err("fail to dequeue data\n");
+                                               }
+                                               return TRUE;
+                                       }
+                                       telephony_sat_emit_send_ss(sat, command_id, text, text_len, ton, npi, ss_string);
+                                       sat_ui_support_launch_ciss_application(TEL_SAT_PROATV_CMD_SEND_SS, send_ss);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_SEND_USSD:{
+                                       GVariant *send_ussd = NULL;
+
+                                       gint command_id;
+                                       gint text_len, ussd_str_len;
+                                       guchar dcs;
+                                       gchar* text, *ussd_string;
+
+                                       GVariant *icon_id;
+
+                                       send_ussd = sat_manager_send_ussd_noti(plugin, (TelSatSendUssdTlv*) &p_ind->proactive_ind_data.send_ussd);
+
+                                       if (!send_ussd) {
+                                               err("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@vyis)", &command_id, &text, &text_len, &icon_id, &dcs, &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;
+                                               int ret;
+                                               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);
+                                               ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_NONE, ui_info);
+                                               if (!ret) {
+                                                       int rv;
+                                                       err("fail to launch sat-ui, remove the queued data!!\n");
+                                                       if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                               err("Fail to send terminal response\n");
+                                                       rv = sat_manager_remove_cmd_by_id(command_id);
+                                                       if (!rv)
+                                                               err("fail to dequeue data\n");
+                                               }
+                                               return TRUE;
+                                       }
+                                       /*TODO: dcs is not passed here. confirm whether is required or not*/
+                                       telephony_sat_emit_setup_ussd(sat, command_id, text, text_len, ussd_string);
+                                       sat_ui_support_launch_ciss_application(TEL_SAT_PROATV_CMD_SEND_USSD, send_ussd);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_SETUP_CALL:{
+                                       GVariant *setup_call = NULL;
+
+                                       gint command_id, call_type, confirmed_text_len, text_len, duration;
+                                       gchar *confirmed_text, *text, *call_number;
+                                       GVariant *icon_id;
+
+                                       setup_call = sat_manager_setup_call_noti(plugin, (TelSatSetupCallTlv*) &p_ind->proactive_ind_data.setup_call);
+
+                                       if (!setup_call) {
+                                               err("no setup call data");
+                                               return TRUE;
+                                       }
+
+                                       dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
+                                       g_variant_get(setup_call, "(isisi@visi)", &command_id, &confirmed_text, &confirmed_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+
+                                       dbg("check display text : text(%s) text len(%d)", confirmed_text, confirmed_text_len);
+                                       if (confirmed_text_len > 1 && (g_strcmp0(confirmed_text,"") != 0) ) {
+                                               GVariant *ui_info = NULL;
+                                               gboolean user_confirm = TRUE;
+                                               int ret;
+                                               dbg("text should be displayed by ui");
+                                               dbg("setup call is pending!!!");
+
+                                               ui_info = g_variant_new("(isib)", command_id, confirmed_text, confirmed_text_len, user_confirm);
+                                               ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_NONE, ui_info);
+                                               if (!ret) {
+                                                       int rv;
+                                                       err("fail to launch sat-ui, remove the queued data!!\n");
+                                                       if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                               err("Fail to send terminal response\n");
+                                                       rv = sat_manager_remove_cmd_by_id(command_id);
+                                                       if (!rv)
+                                                               err("fail to dequeue data\n");
+                                               }
+                                               return TRUE;
+                                       }
+
+                                       telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len,text, text_len, call_type, call_number, duration);
+                                       sat_ui_support_launch_call_application(TEL_SAT_PROATV_CMD_SETUP_CALL, setup_call);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_SETUP_EVENT_LIST:{
+                                       GVariant *event_list = NULL;
+
+                                       gint event_cnt;
+                                       GVariant *evt_list;
+
+                                       event_list = sat_manager_setup_event_list_noti(plugin, (TelSatSetupEventListTlv*) &p_ind->proactive_ind_data.setup_event_list);
+
+                                       if (!event_list) {
+                                               err("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);
+
+                                       //bip proactive command is only handled by BIP Manager
+                                       {
+                                               GDBusConnection *conn = NULL;
+                                               const gchar *g_path = NULL;
+
+                                               conn = g_dbus_object_manager_server_get_connection(sat_data->manager);
+                                               g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+                                               /* TODO: SAT Event Downloader should execute event_list as well. */
+                                               sat_ui_support_exec_evtdw(conn, g_path, TEL_SAT_PROATV_CMD_SETUP_EVENT_LIST, event_list);
+                                               sat_ui_support_exec_bip(conn, g_path, TEL_SAT_PROATV_CMD_SETUP_EVENT_LIST, event_list);
+                                       }
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:{
+                                       GVariant *setup_idle_mode = NULL;
+                                       int ret;
+
+                                       gint command_id, text_len;
+                                       gchar* text;
+                                       GVariant *icon_id;
+
+                                       setup_idle_mode = sat_manager_setup_idle_mode_text_noti(plugin, (TelSatSetupIdleModeTextTlv*) &p_ind->proactive_ind_data.setup_idle_mode_text);
+
+                                       if (!setup_idle_mode) {
+                                               err("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);
+
+                                       ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT, setup_idle_mode);
+                                       if (!ret) {
+                                               int rv;
+                                               err("fail to launch sat-ui, remove the queued data!!\n");
+                                               if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                       err("Fail to send terminal response\n");
+                                               rv = sat_manager_remove_cmd_by_id(command_id);
+                                               if (!rv)
+                                                       err("fail to dequeue data\n");
+                                       }
+
+                                       telephony_sat_emit_setup_idle_mode_text(sat, command_id, text, text_len);
+                               }
+                               break;
+
+                               case TEL_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(plugin, (TelSatOpenChannelTlv*) &p_ind->proactive_ind_data.open_channel);
+
+                                       if (!open_channel) {
+                                               err("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;
+                                               int ret;
+                                               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);
+                                               ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_NONE, ui_info);
+                                                       if (!ret) {
+                                                       int rv;
+                                                       err("fail to launch sat-ui, remove the queued data!!\n");
+                                                       if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                               err("Fail to send terminal response\n");
+                                                       rv = sat_manager_remove_cmd_by_id(command_id);
+                                                       if (!rv)
+                                                               err("fail to dequeue data\n");
+                                               }
+                                               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);*/
+                                       //bip proactive command is only handled by BIP Manager
+                                       {
+                                               GDBusConnection *conn = NULL;
+                                               const gchar *g_path = NULL;
+
+                                               conn = g_dbus_object_manager_server_get_connection(sat_data->manager);
+                                               g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+                                               sat_ui_support_exec_bip(conn, g_path, TEL_SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
+                                       }
+                               }
+                               break;
+
+                               case TEL_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(plugin, (TelSatCloseChannelTlv*) &p_ind->proactive_ind_data.close_channel);
+
+                                       if (!close_channel) {
+                                               err("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);*/
+
+                                       //bip proactive command is only handled by BIP Manager
+                                       {
+                                               GDBusConnection *conn = NULL;
+                                               const gchar *g_path = NULL;
+
+                                               conn = g_dbus_object_manager_server_get_connection(sat_data->manager);
+                                               g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+                                               sat_ui_support_exec_bip(conn, g_path, TEL_SAT_PROATV_CMD_CLOSE_CHANNEL, close_channel);
+                                       }
+
+                               }
+                               break;
+
+                               case TEL_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(plugin, (TelSatReceiveChannelTlv*) &p_ind->proactive_ind_data.receive_data);
+
+                                       if (!receive_data) {
+                                               err("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);*/
+
+                                       //bip proactive command is only handled by BIP Manager
+                                       {
+                                               GDBusConnection *conn = NULL;
+                                               const gchar *g_path = NULL;
+
+                                               conn = g_dbus_object_manager_server_get_connection(sat_data->manager);
+                                               g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+                                               sat_ui_support_exec_bip(conn, g_path, TEL_SAT_PROATV_CMD_RECEIVE_DATA, receive_data);
+                                       }
+
+                               }
+                               break;
+
+                               case TEL_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(plugin, (TelSatSendChannelTlv*) &p_ind->proactive_ind_data.send_data);
+
+                                       if (!send_data) {
+                                               err("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);*/
+
+                                       //bip proactive command is only handled by BIP Manager
+                                       {
+                                               GDBusConnection *conn = NULL;
+                                               const gchar *g_path = NULL;
+
+                                               conn = g_dbus_object_manager_server_get_connection(sat_data->manager);
+                                               g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+                                               sat_ui_support_exec_bip(conn, g_path, TEL_SAT_PROATV_CMD_SEND_DATA, send_data);
+                                       }
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
+                                       GVariant *channel_status = NULL;
+
+                                       gint command_id;
+
+                                       channel_status = sat_manager_get_channel_status_noti(plugin, (TelSatGetChannelStatusTlv*) &p_ind->proactive_ind_data.get_channel_status);
+
+                                       if (!channel_status) {
+                                               err("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);*/
+
+                                       //bip proactive command is only handled by BIP Manager
+                                       {
+                                               GDBusConnection *conn = NULL;
+                                               const gchar *g_path = NULL;
+
+                                               conn = g_dbus_object_manager_server_get_connection(sat_data->manager);
+                                               g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+                                               sat_ui_support_exec_bip(conn, g_path, TEL_SAT_PROATV_CMD_GET_CHANNEL_STATUS, channel_status);
+                                       }
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_REFRESH:{
+                                       GVariant *refresh = NULL;
+                                       gint command_id = 0;
+                                       gint refresh_type =0;
+                                       GVariant *file_list = NULL;
+                                       int ret;
+
+                                       refresh = sat_manager_refresh_noti(plugin, (TelSatRefreshTlv*) &p_ind->proactive_ind_data.refresh);
+
+                                       if (!refresh) {
+                                               err("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);
+
+                                       telephony_sat_emit_refresh(sat, command_id, refresh_type, file_list);
+                                       ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_REFRESH, refresh);
+                                       if (!ret) {
+                                               int rv;
+                                               err("fail to launch sat-ui, remove the queued data!!\n");
+                                               if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                       err("Fail to send terminal response\n");
+                                               rv = sat_manager_remove_cmd_by_id(command_id);
+                                               if (!rv)
+                                                       err("fail to dequeue data\n");
+                                       }
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_MORE_TIME:{
+                                       sat_manager_more_time_noti(plugin, (TelSatMoreTimeTlv*) &p_ind->proactive_ind_data.more_time);
+                                       telephony_sat_emit_more_time(sat);
+                               }
+                               break;
+
+                               case TEL_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(plugin, (TelSatSendDtmfTlv*) &p_ind->proactive_ind_data.send_dtmf);
+                                       if (!send_dtmf) {
+                                               err("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_len, &dtmf_str);
+
+                                       if (text_len > 1 && (g_strcmp0(text,"") != 0) ) {
+                                               GVariant *ui_info = NULL;
+                                               gboolean user_confirm = FALSE;
+                                               int ret;
+                                               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);
+                                               ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_SEND_DTMF, ui_info);
+                                               if (!ret) {
+                                                       int rv;
+                                                       err("fail to launch sat-ui, remove the queued data!!\n");
+                                                       if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                               err("Fail to send terminal response\n");
+                                                       rv = sat_manager_remove_cmd_by_id(command_id);
+                                                       if (!rv)
+                                                               err("fail to dequeue data\n");
+                                               }
+                                               return TRUE;
+                                       }
+                                       telephony_sat_emit_send_dtmf(sat, command_id, text, text_len, dtmf_str, dtmf_str_len);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_LAUNCH_BROWSER:{
+                                       GVariant *launch_browser = NULL;
+                                       gint command_id = 0;
+                                       gint browser_launch_type = 0, 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(plugin, (TelSatLaunchBrowserTlv*) &p_ind->proactive_ind_data.launch_browser);
+                                       if (!launch_browser) {
+                                               err("no launch_browser data");
+                                               return TRUE;
+                                       }
+
+                                       dbg("launch_browser type_format(%s)", g_variant_get_type_string(launch_browser));
+                                       g_variant_get(launch_browser, "(iiisisisi@v)", &command_id, &browser_launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
+
+                                       //Popup is mandatory option in browser case
+                                       {
+                                               GVariant *ui_info = NULL;
+                                               gboolean user_confirm = TRUE;
+                                               int ret;
+                                               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);
+                                               ret = sat_ui_support_launch_sat_ui(TEL_SAT_PROATV_CMD_LAUNCH_BROWSER, ui_info);
+                                               if (!ret) {
+                                                       int rv;
+                                                       err("fail to launch sat-ui, remove the queued data!!\n");
+                                                       if (!sat_manager_handle_sat_ui_launch_fail(plugin, p_ind))
+                                                               err("Fail to send terminal response\n");
+                                                       rv = sat_manager_remove_cmd_by_id(command_id);
+                                                       if (!rv)
+                                                               err("fail to dequeue data\n");
+                                               }
+                                               return TRUE;
+                                       }
+
+                                       //telephony_sat_emit_launch_browser(sat, command_id, browser_launch_type, browser_id, url, url_len, gateway_proxy, gateway_proxy_len, text, text_len);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:{
+                                       GVariant *provide_info = NULL;
+                                       gint info_type = 0;
+
+                                       provide_info = sat_manager_provide_local_info_noti(plugin, comm_plugin, (TelSatProvideLocalInfoTlv*) &p_ind->proactive_ind_data.provide_local_info);
+                                       if (!provide_info) {
+                                               err("no provide_info data");
+                                               return TRUE;
+                                       }
+
+                                       dbg("provide_info type_format(%s)", g_variant_get_type_string(provide_info));
+                                       g_variant_get(provide_info, "(i)", &info_type);
+
+                                       telephony_sat_emit_provide_local_info(sat, info_type);
+                               }
+                               break;
+
+                               case TEL_SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:{
+                                       GVariant *language_noti = NULL;
+                                       gint command_id = 0;
+                                       gint language = 0;
+                                       gboolean is_specified = FALSE;
+
+                                       language_noti = sat_manager_language_notification_noti(plugin, (TelSatLanguageNotificationTlv*) &p_ind->proactive_ind_data.language_notification);
+                                       if (!language_noti) {
+                                               err("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, &is_specified);
+
+                                       sat_manager_update_language(plugin, comm_plugin, language_noti);
+
+                                       telephony_sat_emit_language_notification(sat, command_id, language, is_specified);
+                               }
+                               break;
+
+                               default:{
+                                       gboolean rv = FALSE;
+                                       rv = sat_manager_processing_unsupport_proactive_command(plugin, (TelSatUnsupportCommandTlv *)&p_ind->proactive_ind_data.unsupport_cmd);
+                                       err("not handled ind->cmd_type[0x%x] send error tr result(%d)", p_ind->cmd_type, rv);
+                               }
+                               break;
+                       }
+               }
+               break;
+
+               default:
+                       err("Unhandled Notification: [0x%x]", command);
+               break;
+       }
+
+       return TRUE;
+}
+
diff --git a/src/dtapi_sim.c b/src/dtapi_sim.c
new file mode 100644 (file)
index 0000000..ffe9317
--- /dev/null
@@ -0,0 +1,1663 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_sim.h"
+#include "dtapi_util.h"
+
+#include <plugin.h>
+
+#define AC_SIM         "telephony_framework::api_sim"
+
+static void on_response_dtapi_sim_get_imsi(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimImsiInfo *imsi = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result != TEL_SIM_RESULT_SUCCESS) {
+               telephony_sim_complete_get_imsi(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result, NULL, NULL, NULL);
+       } else {
+               tcore_check_return_assert(NULL != imsi);
+               dbg("mcc[%s] mnc[%s] msin[%s]", imsi->mcc, imsi->mnc, imsi->msin);
+
+               /* Update Properties */
+               telephony_sim_set_mcc(rsp_cb_data->interface_object, imsi->mcc);
+               telephony_sim_set_mnc(rsp_cb_data->interface_object, imsi->mnc);
+               telephony_sim_set_msin(rsp_cb_data->interface_object, imsi->msin);
+
+               telephony_sim_complete_get_imsi(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       imsi->mcc, imsi->mnc, imsi->msin);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_imsi(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SIM_GET_IMSI, NULL, 0,
+                       on_response_dtapi_sim_get_imsi, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS){
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_ecc(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimEccList *sim_ecc_list = data;
+       GVariant *ecc_list;
+       GVariantBuilder variant_builder;
+       guint count = 0;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result: [%d] ", result);
+
+       g_variant_builder_init(&variant_builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != sim_ecc_list);
+
+               dbg("ECC List count: [%d]", sim_ecc_list->count);
+               for (count = 0; count < sim_ecc_list->count; count++) {
+                       g_variant_builder_open(&variant_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "number", g_variant_new_string(sim_ecc_list->list[count].number));
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "name", g_variant_new_string(sim_ecc_list->list[count].name));
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "category", g_variant_new_int32(sim_ecc_list->list[count].category));
+
+                       g_variant_builder_close(&variant_builder);
+
+                       dbg("[%d] : Number: [%s] Name: [%s] Category: [%d]", count,
+                               sim_ecc_list->list[count].number,
+                               sim_ecc_list->list[count].name,
+                               sim_ecc_list->list[count].category);
+               }
+       }
+       ecc_list = g_variant_builder_end(&variant_builder);
+
+       telephony_sim_complete_get_ecc(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, count, ecc_list);
+
+       g_variant_unref(ecc_list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_ecc(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+       /* TBD : ECC list can be cached in sim coreobject and can be used instead of
+         * sending request to modem plugin
+         */
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_GET_ECC, NULL, 0,
+               on_response_dtapi_sim_get_ecc, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS){
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_iccid(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const gchar *iccid = NULL;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d] ", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               iccid = data;
+               dbg("iccid[%s]", iccid);
+       }
+       telephony_sim_complete_get_iccid(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, iccid);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_iccid(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+       /* TBD : ICCID can be cached in sim coreobject and can be used instead of
+         * sending request to modem plugin
+         */
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_GET_ICCID, NULL, 0,
+               on_response_dtapi_sim_get_iccid, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS){
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_sim_get_language(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       TelSimLanguagePreferenceCode language = TEL_SIM_LP_LANG_UNSPECIFIED;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d] ", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != data);
+               language = *(TelSimLanguagePreferenceCode *)data;
+               dbg("language[%d]", language);
+       }
+       telephony_sim_complete_get_language(rsp_cb_data->interface_object,
+                                                       rsp_cb_data->invocation, result, language);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_language(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SIM_GET_LANGUAGE, NULL, 0,
+               on_response_dtapi_sim_get_language, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS){
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_sim_set_language(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       telephony_sim_complete_set_language(rsp_cb_data->interface_object,
+                                                       rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_set_language(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint language, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+       TelSimLanguagePreferenceCode language_preference;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       language_preference = language;
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_SET_LANGUAGE,
+               &language_preference, sizeof(TelSimLanguagePreferenceCode),
+               on_response_dtapi_sim_set_language, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS){
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_call_forwarding_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimCfisList *cf_list = data;
+       guint count = 0;
+       GVariant *list;
+       GVariantBuilder variant_builder;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d] ", result);
+
+       g_variant_builder_init(&variant_builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               gpointer indication;
+               GVariant *indication_var;
+               tcore_check_return_assert(cf_list != NULL);
+
+               dbg("Call forwarding List count: [%d]", cf_list->profile_count);
+               for (count = 0; count < cf_list->profile_count; count++) {
+                       g_variant_builder_open(&variant_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "profile_id", g_variant_new_byte(cf_list->cf[count].profile_id));
+
+                       indication = (gpointer)cf_list->cf[count].indication;
+                       indication_var = g_variant_new_from_data(G_VARIANT_TYPE("ai"),
+                               indication, sizeof(cf_list->cf[count].indication),
+                               TRUE, NULL, NULL);
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "indication", indication_var);
+
+                       g_variant_builder_close(&variant_builder);
+
+                       dbg("[%d] : Profile ID: [%s]", count,
+                               cf_list->cf[count].profile_id);
+               }
+       }
+       list = g_variant_builder_end(&variant_builder);
+
+       telephony_sim_complete_get_call_forwarding_info(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, count, list);
+       g_variant_unref(list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_call_forwarding_info(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SIM_GET_CALL_FORWARDING_INFO, NULL, 0,
+                       on_response_dtapi_sim_get_call_forwarding_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS){
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_message_waiting_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimMwisList *mw_list = data;
+
+       GVariantBuilder variant_builder;
+       GVariant *list = NULL;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       g_variant_builder_init(&variant_builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               GVariantBuilder variant_builder2;
+               GVariant *list2 = NULL;
+               guint count, count2;
+
+               tcore_check_return_assert(mw_list != NULL);
+
+               dbg("Message waiting count: [%d]", mw_list->profile_count);
+
+               for (count = 0; count < mw_list->profile_count; count++) {
+                       g_variant_builder_open(&variant_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "profile_id", g_variant_new_byte(mw_list->mw[count].profile_id));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "count_valid", g_variant_new_boolean(mw_list->mw[count].count_valid));
+
+                       dbg("[%d] Profile ID: [%d] Count valid: [%s]", count,
+                               mw_list->mw[count].profile_id,
+                               mw_list->mw[count].count_valid ? "YES" : "NO");
+
+                       g_variant_builder_init(&variant_builder2, G_VARIANT_TYPE("aa{sv}"));
+                       for (count2 = 0 ; count2 < TEL_SIM_MAILBOX_TYPE_MAX ; count2++) {
+                               g_variant_builder_open(&variant_builder2, G_VARIANT_TYPE("a{sv}"));
+
+                               g_variant_builder_add(&variant_builder2, "{sv}", "indication",
+                                       g_variant_new_boolean(mw_list->mw[count].msg_waiting[count2].indication));
+
+                               g_variant_builder_add(&variant_builder2, "{sv}", "count",
+                                       g_variant_new_byte(mw_list->mw[count].msg_waiting[count2].count));
+
+                               g_variant_builder_close(&variant_builder2);
+                       }
+                       list2 = g_variant_builder_end(&variant_builder2);
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "msg_waiting", list2);
+
+                       g_variant_builder_close(&variant_builder);
+               }
+       }
+       list = g_variant_builder_end(&variant_builder);
+
+       telephony_sim_complete_get_message_waiting_info(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, mw_list->profile_count, list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_message_waiting_info(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SIM_GET_MESSAGE_WAITING_INFO, NULL, 0,
+               on_response_dtapi_sim_get_message_waiting_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS){
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_set_message_waiting_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       telephony_sim_complete_set_message_waiting_info(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_set_message_waiting_info(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       guchar profile_id, gboolean count_valid,
+       GVariant *mw, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimMwis req_data = {0,};
+       DbusRespCbData *rsp_cb_data;
+       GVariantIter *iter = NULL;
+       unsigned int i = 0;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "w") == FALSE)
+               return TRUE;
+
+       req_data.profile_id = profile_id;
+       req_data.count_valid = count_valid;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       g_variant_get(mw, "a(by)", &iter);
+       while (g_variant_iter_next(iter, "(by)",
+                       &(req_data.msg_waiting[i].indication),
+                       &(req_data.msg_waiting[i].count))) {
+               i++;
+       }
+
+       g_variant_iter_free(iter);
+
+       result = tcore_plugin_dispatch_request(plugin,
+               TRUE, TCORE_COMMAND_SIM_SET_MESSAGE_WAITING_INFO,
+               &req_data, sizeof(TelSimMwis),
+               on_response_dtapi_sim_set_message_waiting_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS){
+               dtapi_return_error(invocation,
+                       G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_mailbox_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimMailboxList *mb_list = data;
+       guint count = 0;
+       GVariant *list;
+       GVariantBuilder variant_builder;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       g_variant_builder_init(&variant_builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               GVariant *alpha_id, *number;
+
+               tcore_check_return_assert(mb_list != NULL);
+               dbg("Mailbox list count: [%d]", mb_list->count);
+
+               for (count = 0; count < count; count++) {
+                       g_variant_builder_open(&variant_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "profile_id", g_variant_new_byte(mb_list->list[count].profile_id));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "mb_type", g_variant_new_int32(mb_list->list[count].mb_type));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "alpha_id_len", g_variant_new_uint32(mb_list->list[count].alpha_id_len));
+
+                       alpha_id = g_variant_new_from_data(G_VARIANT_TYPE("ay"),
+                               mb_list->list[count].alpha_id, TEL_SIM_ALPHA_ID_LEN_MAX,
+                               TRUE, NULL, NULL);
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "alpha_id", alpha_id);
+
+                       number = g_variant_new_from_data(G_VARIANT_TYPE("ay"),
+                               mb_list->list[count].number, TEL_SIM_MBDN_NUM_LEN_MAX,
+                               TRUE, NULL, NULL);
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "number", number);
+
+                       g_variant_builder_close(&variant_builder);
+               }
+       }
+       list = g_variant_builder_end(&variant_builder);
+
+       telephony_sim_complete_get_mailbox_info(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, mb_list->alpha_id_max_len, mb_list->count, list);
+       g_variant_unref(list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_mailbox_info(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SIM_GET_MAILBOX_INFO, NULL, 0,
+                       on_response_dtapi_sim_get_mailbox_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_set_mailbox_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       telephony_sim_complete_set_mailbox_info(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_set_mailbox_info(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       guchar profile_id, gint mb_type,
+       gint alpha_id_len, const gchar *alpha_id,
+       const gchar *num, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimMailBoxNumber req_data= {0,};
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       req_data.profile_id = profile_id;
+       req_data.mb_type = mb_type;
+       req_data.alpha_id_len = alpha_id_len;
+       memcpy(req_data.alpha_id, alpha_id, alpha_id_len);
+       memcpy(req_data.number, num, strlen(num));
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_SET_MAILBOX_INFO,
+               &req_data, sizeof(TelSimMailBoxNumber),
+               on_response_dtapi_sim_set_mailbox_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_msisdn(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimMsisdnList *msisdn_list = data;
+       guint count = 0;
+       GVariant *list;
+       GVariantBuilder variant_builder;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       g_variant_builder_init(&variant_builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(msisdn_list != NULL);
+
+               dbg("MSISDN List count: [%d]", msisdn_list->count);
+               for (count = 0; count < msisdn_list->count; count++) {
+                       g_variant_builder_open(&variant_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "alpha_id", g_variant_new_string(msisdn_list->list[count].alpha_id));
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "num", g_variant_new_string(msisdn_list->list[count].num));
+
+                       g_variant_builder_close(&variant_builder);
+
+                       dbg("[%d] : Aplha ID: [%s] Number: [%s]", count,
+                               msisdn_list->list[count].alpha_id,
+                               msisdn_list->list[count].num);
+               }
+       }
+       list = g_variant_builder_end(&variant_builder);
+
+       telephony_sim_complete_get_msisdn(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, count, list);
+       g_variant_unref(list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_msisdn(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_GET_MSISDN,
+               NULL, 0,
+               on_response_dtapi_sim_get_msisdn, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_spn(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimSpn *spn = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d] ", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != spn);
+               dbg("display_condition[%d] spn[%s]", spn->display_condition, spn->spn);
+               telephony_sim_complete_get_spn(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       spn->display_condition, spn->spn);
+       } else {
+               telephony_sim_complete_get_spn(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       TEL_SIM_DISP_INVALID, NULL);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_spn(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_GET_SPN,
+               NULL, 0,
+               on_response_dtapi_sim_get_spn, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_cphs_net_name(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimCphsNetName *cphs_net_name = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d] ", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != cphs_net_name);
+               dbg("full_name[%s] short_name[%s]",
+                       cphs_net_name->full_name, cphs_net_name->short_name);
+               telephony_sim_complete_get_cphs_net_name(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       cphs_net_name->full_name, cphs_net_name->short_name);
+       } else {
+               telephony_sim_complete_get_cphs_net_name(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result, "", "");
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_cphs_net_name(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_GET_CPHS_NET_NAME,
+               NULL, 0,
+               on_response_dtapi_sim_get_cphs_net_name, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_get_sp_display_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimSpPlmnList *sp_list = data;
+       guint count = 0;
+       GVariant *list;
+       GVariantBuilder variant_builder;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       g_variant_builder_init(&variant_builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(sp_list != NULL);
+
+               dbg("SPN List count: [%d]", sp_list->count);
+               for (count = 0; count < sp_list->count; count++) {
+                       g_variant_builder_open(&variant_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "index", g_variant_new_uint32(sp_list->list[count].index));
+                       g_variant_builder_add(&variant_builder, "{sv}",
+                               "plmn", g_variant_new_string(sp_list->list[count].plmn));
+
+                       g_variant_builder_close(&variant_builder);
+
+                       dbg("[%d] : Index: [%d] PLMN: [%s]", count,
+                               sp_list->list[count].index,
+                               sp_list->list[count].plmn);
+               }
+       }
+       list = g_variant_builder_end(&variant_builder);
+
+       telephony_sim_complete_get_sp_display_info(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, count, list);
+       g_variant_unref(list);
+
+       tcore_free(rsp_cb_data);
+}
+
+
+static gboolean dtapi_sim_get_sp_display_info(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_GET_SP_DISPLAY_INFO,
+               NULL, 0,
+               on_response_dtapi_sim_get_sp_display_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_req_authentication(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimAuthenticationResponse *req_auth = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               gchar *encoded_resp, *encoded_autn, *encoded_cipher, *encoded_integrity;
+               tcore_check_return_assert(NULL != req_auth);
+
+               dbg("auth_type[%d] detailed_result[%d] resp_length[%d] \
+               authentication_key_length[%d] cipher_length[%d] integrity_length[%d]",
+               req_auth->auth_type, req_auth->detailed_result, req_auth->resp_length,
+               req_auth->authentication_key_length, req_auth->cipher_length, req_auth->integrity_length);
+               /* Encode Base64 - Resp data */
+               encoded_resp = g_base64_encode((const guchar *)req_auth->resp_data,
+                                       req_auth->resp_length);
+
+               /* Encode Base64 - auth data */
+               encoded_autn = g_base64_encode((const guchar *)req_auth->authentication_key,
+                                       req_auth->authentication_key_length);
+
+               /* Encode Base64 - cipher data */
+               encoded_cipher = g_base64_encode((const guchar *)req_auth->cipher_data,
+                                       req_auth->cipher_length);
+
+               /* Encode Base64 - integrity data */
+               encoded_integrity = g_base64_encode((const guchar *)req_auth->integrity_data,
+                                       req_auth->integrity_length);
+
+               telephony_sim_complete_req_authentication(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       req_auth->auth_type, encoded_resp,
+                       encoded_autn, encoded_cipher, encoded_integrity);
+               /* Free resources */
+               tcore_free(encoded_resp);
+               tcore_free(encoded_autn);
+               tcore_free(encoded_cipher);
+               tcore_free(encoded_integrity);
+       } else {
+               telephony_sim_complete_req_authentication(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       0, NULL, NULL, NULL, NULL);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_req_authentication(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint auth_type, const gchar *rand_data,
+       const gchar *autn_data, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+       guchar *decoded_data;
+       TelSimAuthenticationData req_data = {0,};
+       gsize decoded_data_len;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "x") == FALSE)
+               return TRUE;
+
+       req_data.auth_type = auth_type;
+
+       /* Decode Base64 - rand data */
+       decoded_data = g_base64_decode((const gchar *)rand_data, &decoded_data_len);
+       if ((decoded_data_len > TEL_SIM_AUTH_MAX_REQ_DATA_LEN) ||(decoded_data_len == 0)) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Decoding Failed");
+               tcore_free(decoded_data);
+               return TRUE;
+       }
+
+       memcpy(req_data.rand_data, decoded_data, decoded_data_len);
+       req_data.rand_length = decoded_data_len;
+
+       /* Free resources */
+       tcore_free(decoded_data);
+
+       /* Decode Base64 - auth data */
+       decoded_data = g_base64_decode((const gchar *)autn_data, &decoded_data_len);
+       if (decoded_data_len > TEL_SIM_AUTH_MAX_REQ_DATA_LEN) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Decoding Failed");
+               tcore_free(decoded_data);
+               return TRUE;
+       }
+
+       if(decoded_data_len)
+               memcpy(req_data.autn_data, decoded_data, decoded_data_len);
+       req_data.autn_length = decoded_data_len;
+
+       /* Free resources */
+       tcore_free(decoded_data);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_REQ_AUTHENTICATION,
+               &req_data, sizeof(TelSimAuthenticationData),
+               on_response_dtapi_sim_req_authentication, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_verify_pins(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimSecPinResult *verify_pins = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != verify_pins);
+               dbg("pin_type[%d] retry_count[%d]",
+                       verify_pins->pin_type, verify_pins->retry_count);
+               telephony_sim_complete_verify_pins(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       verify_pins->pin_type, verify_pins->retry_count);
+       } else {
+               telephony_sim_complete_verify_pins(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result, 0, 0);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_verify_pins(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint pin_type, const gchar *pw,
+       gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimSecPinPw req_data = {0,};
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       req_data.pin_type =  pin_type;
+       req_data.pw = (char *)pw;
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_VERIFY_PINS,
+               &req_data, sizeof(TelSimSecPinPw),
+               on_response_dtapi_sim_verify_pins, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_verify_puks(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimSecPukResult *verify_puks = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != verify_puks);
+               dbg("puk_type[%d] retry_count[%d]",
+                       verify_puks->puk_type, verify_puks->retry_count);
+
+               telephony_sim_complete_verify_puks(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       verify_puks->puk_type, verify_puks->retry_count);
+       } else {
+               telephony_sim_complete_verify_puks(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result, 0, 0);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_verify_puks(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint puk_type, const gchar *puk_pw,
+       const gchar *new_pin_pw, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimSecPukPw req_data = {0,};
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       req_data.puk_type =  puk_type;
+       req_data.puk_pw = (char *)puk_pw;
+       req_data.new_pin_pw = (char *)new_pin_pw;
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_VERIFY_PUKS,
+               &req_data, sizeof(TelSimSecPukPw),
+               on_response_dtapi_sim_verify_puks, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sim_change_pins(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimSecPinResult *change_pins = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != change_pins);
+               dbg("pin_type[%d] retry_count[%d]",
+                       change_pins->pin_type, change_pins->retry_count);
+               telephony_sim_complete_change_pins(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       change_pins->pin_type, change_pins->retry_count);
+       } else {
+               telephony_sim_complete_change_pins(rsp_cb_data->interface_object,
+                                                       rsp_cb_data->invocation, result, 0, 0);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_change_pins(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint pin_type, const gchar *old_pw,
+       const gchar *new_pw, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+       TelSimSecChangePinPw req_data = {0,};
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       req_data.pin_type =  pin_type;
+       req_data.old_pw = (char *)old_pw;
+       req_data.new_pw = (char *)new_pw;
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_CHANGE_PINS,
+               &req_data, sizeof(TelSimSecChangePinPw),
+               on_response_dtapi_sim_change_pins, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_sim_disable_facility(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimFacilityResult *facility = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != facility);
+               dbg("type[%d] retry_count[%d]", facility->type, facility->retry_count);
+               telephony_sim_complete_disable_facility(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       facility->type, facility->retry_count);
+       } else {
+               telephony_sim_complete_disable_facility(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       0, 0);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_disable_facility(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint lock_type, const gchar *pw, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimFacilityPw req_data= {0,};
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       req_data.lock_type =  lock_type;
+       req_data.pw = (char *)pw;
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_DISABLE_FACILITY,
+               &req_data, sizeof(TelSimFacilityPw),
+               on_response_dtapi_sim_disable_facility, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_sim_enable_facility(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimFacilityResult *facility = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != facility);
+               dbg("type[%d] retry_count[%d]", facility->type, facility->retry_count);
+
+               telephony_sim_complete_enable_facility(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       facility->type, facility->retry_count);
+       } else {
+               telephony_sim_complete_enable_facility(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       0, 0);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_enable_facility(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint lock_type, const gchar *pw, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimFacilityPw req_data = {0,};
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       req_data.lock_type =  lock_type;
+       req_data.pw = (char *)pw;
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_ENABLE_FACILITY,
+               &req_data, sizeof(TelSimFacilityPw),
+               on_response_dtapi_sim_enable_facility, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_sim_get_facility(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimFacilityInfo *facility = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != facility);
+               dbg("type[%d] f_status[%d]",  facility->type, facility->f_status);
+               telephony_sim_complete_get_facility(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       facility->type, facility->f_status);
+       } else {
+               telephony_sim_complete_get_facility(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       0, TEL_SIM_FACILITY_STATUS_UNKNOWN);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_facility(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint type, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimFacilityInfo req_data = {0,};
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       req_data.type =  type;
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_GET_FACILITY,
+               &req_data, sizeof(TelSimFacilityInfo),
+               on_response_dtapi_sim_get_facility, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_sim_get_lock_info(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimLockInfo *lock_info = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != lock_info);
+               dbg("lock_type[%d] lock_status[%d] retry_count[%d]",
+               lock_info->lock_type, lock_info->lock_status, lock_info->retry_count);
+               telephony_sim_complete_get_lock_info(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       lock_info->lock_type, lock_info->lock_status,
+                       lock_info->retry_count);
+       } else {
+               telephony_sim_complete_get_lock_info(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       0, 0, 0);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_get_lock_info(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       gint type, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimLockInfo req_data = {0,};
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       req_data.lock_type =  type;
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE, TCORE_COMMAND_SIM_GET_LOCK_INFO, &req_data, sizeof(TelSimLockInfo),
+                       on_response_dtapi_sim_get_lock_info, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_sim_req_apdu(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimApduResp *apdu = data;
+
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               gchar *encoded_apdu;
+               tcore_check_return_assert(NULL != apdu);
+               dbg("apdu_resp_len[%d]", apdu->apdu_resp_len);
+               /* Encode Base64 - Resp data */
+               encoded_apdu = g_base64_encode((const guchar *)apdu->apdu_resp,
+                                       apdu->apdu_resp_len);
+               telephony_sim_complete_req_apdu(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       encoded_apdu);
+
+               /* Free resources */
+               tcore_free(encoded_apdu);
+       } else {
+               telephony_sim_complete_req_apdu(rsp_cb_data->interface_object,
+                       rsp_cb_data->invocation, result,
+                       NULL);
+       }
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_req_apdu(TelephonySim *sim,
+       GDBusMethodInvocation *invocation,
+       const gchar *apdu, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       TelSimApdu req_data = {0,};
+       guchar *decoded_data;
+       gsize decoded_data_len;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "x") == FALSE)
+               return TRUE;
+
+       /* Decode Base64 - apdu */
+       decoded_data = g_base64_decode((const gchar *)apdu, &decoded_data_len);
+       if ((decoded_data_len > TEL_SIM_APDU_LEN_MAX) || (decoded_data_len == 0)) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Decoding Failed");
+               tcore_free(decoded_data);
+               return TRUE;
+       }
+
+       memcpy(req_data.apdu, decoded_data, decoded_data_len);
+       req_data.apdu_len = decoded_data_len;
+
+       /* Free resources */
+       tcore_free(decoded_data);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_REQ_APDU,
+               &req_data, sizeof(TelSimApdu),
+               on_response_dtapi_sim_req_apdu, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void
+on_response_dtapi_sim_req_atr(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       const TelSimAtr *atr_resp = data;
+       gchar *encoded_atr  = NULL;
+       tcore_check_return_assert(NULL != rsp_cb_data);
+
+       dbg("result[%d]", result);
+
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               tcore_check_return_assert(NULL != atr_resp);
+               dbg("atr_len[%d]", atr_resp->atr_len);
+               /* Encode Base64 - Resp data */
+               encoded_atr = g_base64_encode((const guchar *)atr_resp->atr,
+                                       atr_resp->atr_len);
+       } else {
+               err("Sim atr response failed!!");
+       }
+
+       telephony_sim_complete_req_atr(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, encoded_atr);
+
+       tcore_free(encoded_atr);
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sim_req_atr(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *rsp_cb_data;
+
+       if (dtapi_check_access_control(invocation, AC_SIM, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sim, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SIM_REQ_ATR,
+               NULL, 0,
+               on_response_dtapi_sim_req_atr, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_sim_interface(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin)
+{
+       TelephonySim *sim = telephony_sim_skeleton_new();
+       GVariant *var;
+       GVariantBuilder var_builder;
+       tcore_check_return_value_assert(sim != NULL, FALSE);
+
+       telephony_object_skeleton_set_sim(object, sim);
+       g_object_unref(sim);
+
+       dbg("sim = %p", sim);
+
+       g_signal_connect (sim,
+                       "handle-get-imsi",
+                       G_CALLBACK (dtapi_sim_get_imsi),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-ecc",
+                       G_CALLBACK (dtapi_sim_get_ecc),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-iccid",
+                       G_CALLBACK (dtapi_sim_get_iccid),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-language",
+                       G_CALLBACK (dtapi_sim_get_language),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-set-language",
+                       G_CALLBACK (dtapi_sim_set_language),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-call-forwarding-info",
+                       G_CALLBACK (dtapi_sim_get_call_forwarding_info),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-message-waiting-info",
+                       G_CALLBACK (dtapi_sim_get_message_waiting_info),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-set-message-waiting-info",
+                       G_CALLBACK (dtapi_sim_set_message_waiting_info),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-mailbox-info",
+                       G_CALLBACK (dtapi_sim_get_mailbox_info),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-set-mailbox-info",
+                       G_CALLBACK (dtapi_sim_set_mailbox_info),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-msisdn",
+                       G_CALLBACK (dtapi_sim_get_msisdn),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-spn",
+                       G_CALLBACK (dtapi_sim_get_spn),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-cphs-net-name",
+                       G_CALLBACK (dtapi_sim_get_cphs_net_name),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-sp-display-info",
+                       G_CALLBACK (dtapi_sim_get_sp_display_info),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-req-authentication",
+                       G_CALLBACK (dtapi_sim_req_authentication),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-verify-pins",
+                       G_CALLBACK (dtapi_sim_verify_pins),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-verify-puks",
+                       G_CALLBACK (dtapi_sim_verify_puks),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-change-pins",
+                       G_CALLBACK (dtapi_sim_change_pins),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-disable-facility",
+                       G_CALLBACK (dtapi_sim_disable_facility),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-enable-facility",
+                       G_CALLBACK (dtapi_sim_enable_facility),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-facility",
+                       G_CALLBACK (dtapi_sim_get_facility),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-get-lock-info",
+                       G_CALLBACK (dtapi_sim_get_lock_info),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-req-apdu",
+                       G_CALLBACK (dtapi_sim_req_apdu),
+                       plugin);
+
+       g_signal_connect (sim,
+                       "handle-req-atr",
+                       G_CALLBACK (dtapi_sim_req_atr),
+                       plugin);
+
+       /* Initialize D-Bus properties */
+       g_variant_builder_init(&var_builder, G_VARIANT_TYPE("a{sv}"));
+       g_variant_builder_add(&var_builder, "{sv}", "status",
+               g_variant_new_int32(TEL_SIM_STATUS_UNKNOWN));
+       g_variant_builder_add(&var_builder, "{sv}", "change_status",
+               g_variant_new_int32(TEL_SIM_CHANGE_STATUS_UNKNOWN));
+       var = g_variant_builder_end(&var_builder);
+       telephony_sim_set_card_status(sim, var);
+
+       telephony_sim_set_sim_type(sim, TEL_SIM_CARD_TYPE_UNKNOWN);
+       telephony_sim_set_mcc(sim, NULL);
+       telephony_sim_set_mnc(sim, NULL);
+       telephony_sim_set_msin(sim, NULL);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_sim_notification(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin, TcoreNotification command,
+       guint data_len, const void *data)
+{
+       TelephonySim *sim;
+
+       tcore_check_return_value_assert(object != NULL, FALSE);
+
+       sim = telephony_object_peek_sim(TELEPHONY_OBJECT(object));
+
+       dbg("sim = %p - notification !!! (command = 0x%x, data_len = %d)",
+               sim, command, data_len);
+
+       switch (command) {
+       case TCORE_NOTIFICATION_SIM_TYPE: {
+               tcore_check_return_value_assert(data != NULL, FALSE);
+
+               const TelSimCardType sim_type = *(TelSimCardType *)data;
+               dbg("SIM Type: [%d]", sim_type);
+
+               /* Update Property */
+               telephony_sim_set_sim_type(sim, sim_type);
+       }
+       break;
+       case TCORE_NOTIFICATION_SIM_STATUS: {
+               const TelSimCardStatusInfo *sim_info = (TelSimCardStatusInfo *)data;
+               GVariant *var;
+               GVariantBuilder var_builder;
+               tcore_check_return_value_assert(data != NULL, FALSE);
+
+               dbg("SIM Status: [%d], change_status: [%d]",
+                       sim_info->status, sim_info->change_status);
+
+               g_variant_builder_init(&var_builder, G_VARIANT_TYPE("a{sv}"));
+               g_variant_builder_add(&var_builder, "{sv}", "status",
+                       g_variant_new_int32(sim_info->status));
+               g_variant_builder_add(&var_builder, "{sv}", "change_status",
+                       g_variant_new_int32(sim_info->change_status));
+               var = g_variant_builder_end(&var_builder);
+
+               telephony_sim_set_card_status(sim, var);
+       }
+       break;
+       default:
+               /* TBD : Check when other dbus properties should be updated */
+               err("not handled cmd[0x%x]", command);
+       break;
+       }
+
+       return TRUE;
+}
diff --git a/src/dtapi_sms.c b/src/dtapi_sms.c
new file mode 100644 (file)
index 0000000..87affd2
--- /dev/null
@@ -0,0 +1,1111 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_sms.h"
+#include "dtapi_util.h"
+
+#include <plugin.h>
+#include <tel_sms.h>
+
+#define AC_SMS         "telephony_framework::api_sms"
+
+static void on_response_dtapi_sms_send(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       dbg("SEND_MSG_RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_sms_complete_send(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_send(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       gboolean more_msgs, GVariant *sca, const gchar *tpdu,
+       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+
+       TelSmsSendInfo send_msg;
+       gsize decoded_tpdu_length;
+       guchar *decoded_tpdu = NULL;
+
+       GVariantIter *iter = NULL;
+       GVariant *key_value;
+       const gchar *key;
+
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "x") == FALSE)
+               return TRUE;
+
+       if (NULL == tpdu || NULL == sca) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid Parameter");
+               return TRUE;
+       }
+
+       decoded_tpdu = g_base64_decode(tpdu, &decoded_tpdu_length);
+       if (decoded_tpdu_length > (TEL_SMS_SMDATA_SIZE_MAX + 1)) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Tpdu Decoding Failed");
+               tcore_free(decoded_tpdu);
+               return TRUE;
+       }
+
+       memset (&send_msg, 0x0, sizeof(TelSmsSendInfo));
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+       send_msg.more_msgs = more_msgs;
+
+       g_variant_get(sca, "a{sv}", &iter);
+       while (g_variant_iter_loop(iter, "{sv}", &key, &key_value)) {
+               if (g_strcmp0(key, "ton") == 0) {
+                       send_msg.send_data.sca.ton = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "npi") == 0) {
+                       send_msg.send_data.sca.npi = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "number") == 0) {
+                       g_strlcpy(send_msg.send_data.sca.number,
+                               g_variant_get_string(key_value, NULL),
+                               TEL_SMS_SCA_LEN_MAX + 1);
+               }
+       }
+       g_variant_iter_free(iter);
+
+       memcpy(&(send_msg.send_data.tpdu[0]), decoded_tpdu, decoded_tpdu_length);
+       send_msg.send_data.tpdu_length = decoded_tpdu_length;
+       tcore_free(decoded_tpdu);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_SEND_SMS,
+               &send_msg, sizeof(TelSmsSendInfo),
+               on_response_dtapi_sms_send, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_read_in_sim(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       gint status = 0;
+       gchar *tpdu = NULL;
+
+       GVariantBuilder sca_builder;
+       GVariant *sca = NULL;
+
+       dbg("READ_MSG_RESPONSE RECEIVED - result:[%d]", result);
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       g_variant_builder_init(&sca_builder, G_VARIANT_TYPE("a{sv}"));
+       if (TEL_SMS_RESULT_SUCCESS == result) {
+               const TelSmsSimDataInfo *read_sms = data;
+
+               tcore_check_return_assert(read_sms != NULL);
+               tcore_check_return_assert(read_sms->data.tpdu_length <= TEL_SMS_SMDATA_SIZE_MAX);
+               tcore_check_return_assert(read_sms->data.tpdu_length != 0);
+
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "ton", g_variant_new_byte(read_sms->data.sca.ton));
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "npi", g_variant_new_byte(read_sms->data.sca.npi));
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "number", g_variant_new_string(read_sms->data.sca.number));
+
+               tpdu = g_base64_encode(&(read_sms->data.tpdu[0]),
+                       read_sms->data.tpdu_length);
+               status  = read_sms->status;
+       } else {
+               tpdu = g_strdup(" ");
+       }
+       sca = g_variant_builder_end(&sca_builder);
+
+       telephony_sms_complete_read_in_sim(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, status, sca, tpdu);
+
+       tcore_free(rsp_cb_data);
+       tcore_free(tpdu);
+}
+
+static gboolean dtapi_sms_read_in_sim(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       guint index, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_READ_IN_SIM,
+               &index, sizeof(guint),
+               on_response_dtapi_sms_read_in_sim, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_write_in_sim(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       guint index = 0;
+
+       dbg("WRITE_SMS_RESPONSE_RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       if (TEL_SMS_RESULT_SUCCESS == result) {
+               tcore_check_return_assert(NULL != data);
+               index = *(guint *)data;
+               dbg("SMS writen to index: [%d]", index);
+       }
+
+       telephony_sms_complete_write_in_sim(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, index);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_write_in_sim(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       gint status, GVariant *sca, const gchar *tpdu,
+       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+
+       TelSmsSimDataInfo write_data;
+       guchar *decoded_tpdu = NULL;
+       gsize decoded_tpdu_length = 0;
+
+       GVariantIter *iter = NULL;
+       GVariant *key_value;
+       const gchar *key;
+
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "w") == FALSE)
+               return TRUE;
+
+       if (NULL == sca || NULL == tpdu) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid Parameter");
+               return TRUE;
+       }
+
+       g_variant_get(sca, "a{sv}", &iter);
+       while (g_variant_iter_loop(iter, "{sv}", &key, &key_value)) {
+               if (g_strcmp0(key, "ton") == 0) {
+                       write_data.data.sca.ton = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "npi") == 0) {
+                       write_data.data.sca.npi = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "number") == 0) {
+                       g_strlcpy(write_data.data.sca.number,
+                               g_variant_get_string(key_value, NULL),
+                               TEL_SMS_SCA_LEN_MAX + 1);
+               }
+       }
+       g_variant_iter_free(iter);
+
+       decoded_tpdu = g_base64_decode(tpdu, &decoded_tpdu_length);
+       memcpy(&(write_data.data.tpdu[0]), decoded_tpdu, decoded_tpdu_length);
+       write_data.data.tpdu_length = decoded_tpdu_length;
+       write_data.status = status;
+
+       /* Free decoded data */
+       tcore_free(decoded_tpdu);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_WRITE_IN_SIM,
+               &write_data, sizeof(TelSmsSimDataInfo),
+               on_response_dtapi_sms_write_in_sim, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_delete_in_sim(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       dbg("DELETE_SMS RESPONSE RECEIVED - result: [%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_sms_complete_delete_in_sim(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_delete_in_sim(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       guint index, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "x") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_DELETE_IN_SIM,
+               &index, sizeof(guint),
+               on_response_dtapi_sms_delete_in_sim, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_get_count(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       GVariant *index_list = NULL;
+       GVariantBuilder index;
+       unsigned int iter;
+       unsigned int total_count = 0;
+       unsigned int used_count = 0;
+
+       dbg("GET_COUNT_RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       g_variant_builder_init(&index, G_VARIANT_TYPE("au"));
+       if (TEL_SMS_RESULT_SUCCESS == result) {
+               const TelSmsStoredMsgCountInfo *count_info = data;
+               tcore_check_return_assert(NULL != count_info);
+
+               total_count =  count_info->total_count;
+               used_count = count_info->used_count;
+               dbg("Total count: [%d] Used count: [%d]",
+                       total_count, used_count);
+
+               for (iter = 0; iter < total_count; iter++) {
+                       dbg("count_info->index_list[%d] - %d", iter , count_info->index_list[iter]);
+                       g_variant_builder_add(&index, "u", count_info->index_list[iter]);
+               }
+       }
+       else {
+               err("SMS get count failed!!!");
+       }
+       index_list = g_variant_builder_end(&index);
+
+       telephony_sms_complete_get_count(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result,
+               total_count, used_count, index_list);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_get_count(TelephonySms *sms,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_GET_COUNT,
+               NULL, 0,
+               on_response_dtapi_sms_get_count, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_set_cb_config(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       dbg("SET_CB_CONFIG RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_sms_complete_set_cb_config(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_set_cb_config(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       gboolean cb_enabled,
+       guint msg_id_range_cnt, GVariant *msg_ids,
+       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+
+       TelSmsCbConfigInfo cb_conf;
+
+       GVariantIter *iter = NULL, *iter_row = NULL;
+       GVariant *key_value;
+       const gchar *key;
+       guint count = 0;
+
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       memset(&cb_conf, 0x0, sizeof(TelSmsCbConfigInfo));
+       cb_conf.cb_enabled = cb_enabled;
+       cb_conf.msg_id_range_cnt = msg_id_range_cnt;
+
+       g_variant_get(msg_ids, "aa{sv}", &iter);
+       while (g_variant_iter_next(iter, "a{sv}", &iter_row)) {
+               while (g_variant_iter_loop(iter_row, "{sv}", &key, &key_value)) {
+                       if (g_strcmp0(key, "from_msg_id") == 0) {
+                               cb_conf.msg_ids[count].from_msg_id =
+                                       g_variant_get_uint16(key_value);
+                       }
+                       else if (g_strcmp0(key, "to_msg_id") == 0) {
+                               cb_conf.msg_ids[count].to_msg_id =
+                                       g_variant_get_uint16(key_value);
+                       }
+                       else if (g_strcmp0(key, "number") == 0) {
+                               cb_conf.msg_ids[count].selected =
+                                       g_variant_get_boolean(key_value);
+                       }
+               }
+               count++;
+               g_variant_iter_free(iter_row);
+       }
+       g_variant_iter_free(iter);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_SET_CB_CONFIG,
+               &cb_conf, sizeof(TelSmsCbConfigInfo),
+               on_response_dtapi_sms_set_cb_config, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_get_cb_config(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+
+       GVariantBuilder config_builder;
+
+       GVariant *msg_ids = NULL;
+       gboolean cb_enabled = FALSE;
+       guint msg_id_range_cnt = 0;
+
+       dbg("GET_CB_CONFIG RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       g_variant_builder_init(&config_builder, G_VARIANT_TYPE("aa{sv}"));
+       if (TEL_SMS_RESULT_SUCCESS == result) {
+               const TelSmsCbConfigInfo *config = data;
+               guint count = 0;
+               tcore_check_return_assert(NULL != config);
+
+               cb_enabled = config->cb_enabled;
+               msg_id_range_cnt = config->msg_id_range_cnt;
+
+               for (count = 0; count < config->msg_id_range_cnt; count++) {
+                       g_variant_builder_open(&config_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&config_builder, "{sv}",
+                               "from_msg_id",
+                               g_variant_new_uint16(config->msg_ids[count].from_msg_id));
+                       g_variant_builder_add(&config_builder, "{sv}",
+                               "to_msg_id",
+                               g_variant_new_uint16(config->msg_ids[count].to_msg_id));
+                       g_variant_builder_add(&config_builder, "{sv}",
+                               "selected",
+                               g_variant_new_boolean(config->msg_ids[count].selected));
+
+                       g_variant_builder_close(&config_builder);
+               }
+       }
+       msg_ids = g_variant_builder_end(&config_builder);
+
+       telephony_sms_complete_get_cb_config(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result,
+               cb_enabled, msg_id_range_cnt, msg_ids);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_get_cb_config(TelephonySms *sms,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_GET_CB_CONFIG,
+               NULL, 0,
+               on_response_dtapi_sms_get_cb_config, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_get_parameters(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       GVariant *params = NULL;
+       GVariantBuilder params_builder;
+       guint count = 0;
+
+       dbg("GET_SMS_PARAMETERS RESPONSE RECEIVED - result:[%d]", result);
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       g_variant_builder_init(&params_builder, G_VARIANT_TYPE("aa{sv}"));
+       if (TEL_SMS_RESULT_SUCCESS == result) {
+               const TelSmsParamsInfoList *param_list = data;
+               GVariantBuilder sca_builder;
+               GVariant *sca;
+
+               tcore_check_return_assert(param_list != NULL);
+
+               for (count = 0; count < param_list->count; count++) {
+                       g_variant_builder_open(&params_builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&params_builder, "{sv}",
+                               "index", g_variant_new_uint32(param_list->params[count].index));
+
+                       g_variant_builder_init(&sca_builder, G_VARIANT_TYPE("a{sv}"));
+                       g_variant_builder_add(&sca_builder, "{sv}",
+                               "ton", g_variant_new_byte(param_list->params[count].sca.ton));
+                       g_variant_builder_add(&sca_builder, "{sv}",
+                               "npi", g_variant_new_byte(param_list->params[count].sca.npi));
+                       g_variant_builder_add(&sca_builder, "{sv}",
+                               "number", g_variant_new_string(param_list->params[count].sca.number));
+                       sca = g_variant_builder_end(&sca_builder);
+                       g_variant_builder_add(&params_builder, "{sv}",
+                               "sca", sca);
+
+                       g_variant_builder_add(&params_builder, "{sv}",
+                               "vp", g_variant_new_uint16(param_list->params[count].vp));
+
+                       g_variant_builder_close(&params_builder);
+               }
+       }
+       params = g_variant_builder_end(&params_builder);
+
+       telephony_sms_complete_get_parameters(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, count, params);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_get_parameters(TelephonySms *sms,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_GET_PARAMETERS,
+               NULL, 0,
+               on_response_dtapi_sms_get_parameters, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_set_parameters(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       dbg("SET_SMS_PARAMETERS RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_sms_complete_set_parameters(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_set_parameters(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       guint index, GVariant *sca, guint16 vp,
+       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin = user_data;
+
+       TelSmsParamsInfo set_params = {0, };
+
+       GVariantIter *iter = NULL;
+       GVariant *key_value;
+       const gchar *key;
+
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "w") == FALSE)
+               return TRUE;
+
+       set_params.index = index;
+       set_params.vp = vp;
+
+       g_variant_get(sca, "a{sv}", &iter);
+       while (g_variant_iter_loop(iter, "{sv}", &key, &key_value)) {
+               if (g_strcmp0(key, "ton") == 0) {
+                       set_params.sca.ton = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "npi") == 0) {
+                       set_params.sca.npi = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "number") == 0) {
+                       g_strlcpy(set_params.sca.number,
+                               g_variant_get_string(key_value, NULL),
+                               TEL_SMS_SCA_LEN_MAX + 1);
+               }
+       }
+       g_variant_iter_free(iter);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_SET_PARAMETERS,
+               &set_params, sizeof(TelSmsParamsInfo),
+               on_response_dtapi_sms_set_parameters, rsp_cb_data);
+
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_send_deliver_report(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       dbg("SEND_DELIVER_REPORT RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_sms_complete_send_deliver_report(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_send_deliver_report(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       gint report, GVariant *sca, const gchar *tpdu,
+       gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+
+       TelSmsDeliverReportInfo dr_info;
+       gsize decoded_tpdu_length;
+       guchar *decoded_tpdu = NULL;
+
+       GVariantIter *iter = NULL;
+       GVariant *key_value;
+       const gchar *key;
+
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "w") == FALSE)
+               return TRUE;
+
+       if (NULL == sca || NULL == tpdu) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid Parameter");
+               return TRUE;
+       }
+
+       decoded_tpdu = g_base64_decode(tpdu, &decoded_tpdu_length);
+       if (decoded_tpdu_length > (TEL_SMS_SMDATA_SIZE_MAX + 1)) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Tpdu Decoding Failed");
+               tcore_free(decoded_tpdu);
+               return TRUE;
+       }
+
+       memset (&dr_info, 0x0, sizeof(TelSmsDeliverReportInfo));
+       dr_info.report = report;
+       memcpy(&(dr_info.data.tpdu[0]), decoded_tpdu, decoded_tpdu_length);
+       dr_info.data.tpdu_length = decoded_tpdu_length;
+       tcore_free(decoded_tpdu);
+
+       g_variant_get(sca, "a{sv}", &iter);
+       while (g_variant_iter_loop(iter, "{sv}", &key, &key_value)) {
+               if (g_strcmp0(key, "ton") == 0) {
+                       dr_info.data.sca.ton = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "npi") == 0) {
+                       dr_info.data.sca.npi = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "number") == 0) {
+                       g_strlcpy(dr_info.data.sca.number,
+                               g_variant_get_string(key_value, NULL),
+                               TEL_SMS_SCA_LEN_MAX + 1);
+               }
+       }
+       g_variant_iter_free(iter);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_SEND_DELIVER_REPORT,
+               &dr_info, sizeof(TelSmsDeliverReportInfo),
+               on_response_dtapi_sms_send_deliver_report, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_set_sca(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       dbg("SET_SCA RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_sms_complete_set_sca(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_set_sca(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       GVariant *sca, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+
+       TelSmsSca req_sca;
+
+       GVariantIter *iter = NULL;
+       GVariant *key_value;
+       const gchar *key;
+
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "w") == FALSE)
+               return TRUE;
+
+       if (NULL == sca) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Invalid Parameter");
+               return TRUE;
+       }
+
+       memset(&req_sca, 0x0, sizeof(TelSmsSca));
+
+       g_variant_get(sca, "a{sv}", &iter);
+       while (g_variant_iter_loop(iter, "{sv}", &key, &key_value)) {
+               if (g_strcmp0(key, "ton") == 0) {
+                       req_sca.ton = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "npi") == 0) {
+                       req_sca.npi = g_variant_get_byte(key_value);
+               }
+               else if (g_strcmp0(key, "number") == 0) {
+                       g_strlcpy(req_sca.number,
+                               g_variant_get_string(key_value, NULL),
+                               TEL_SMS_SCA_LEN_MAX + 1);
+               }
+       }
+       g_variant_iter_free(iter);
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_SET_SCA,
+               &req_sca, sizeof(TelSmsSca),
+               on_response_dtapi_sms_set_sca, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_get_sca(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       GVariant *sca = NULL;
+       GVariantBuilder sca_builder;
+
+       dbg("GET SCA RESPONSE RECEIVED- result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       g_variant_builder_init(&sca_builder, G_VARIANT_TYPE("a{sv}"));
+       if (TEL_SMS_RESULT_SUCCESS == result) {
+               const TelSmsSca *sca_req = data;
+               tcore_check_return_assert(sca_req != NULL);
+
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "ton", g_variant_new_byte(sca_req->ton));
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "npi", g_variant_new_byte(sca_req->npi));
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "number", g_variant_new_string(sca_req->number));
+       }
+       sca = g_variant_builder_end(&sca_builder);
+
+       telephony_sms_complete_get_sca(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result, sca);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_get_sca(TelephonySms *sms,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "r") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_GET_SCA,
+               NULL, 0,
+               on_response_dtapi_sms_get_sca, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_set_memory_status(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       dbg("SET_MEMORY STATUS RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_sms_complete_set_memory_status(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_set_memory_status(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       gboolean available, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+       TelReturn result;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "w") == FALSE)
+               return TRUE;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_SET_MEMORY_STATUS,
+               &available, sizeof(gboolean),
+               on_response_dtapi_sms_set_memory_status, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_sms_set_message_status(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *rsp_cb_data = cb_data;
+       dbg("SET_MESSAGE STATUS RESPONSE RECEIVED - result:[%d]", result);
+
+       tcore_check_return_assert(rsp_cb_data != NULL);
+
+       telephony_sms_complete_set_message_status(rsp_cb_data->interface_object,
+               rsp_cb_data->invocation, result);
+
+       tcore_free(rsp_cb_data);
+}
+
+static gboolean dtapi_sms_set_message_status(TelephonySms *sms,
+       GDBusMethodInvocation *invocation,
+       guint index, gint status, gpointer user_data)
+{
+       DbusRespCbData *rsp_cb_data = NULL;
+       TcorePlugin *plugin =  user_data;
+       TelReturn result;
+       TelSmsStatusInfo info;
+
+       if (dtapi_check_access_control(invocation, AC_SMS, "w") == FALSE)
+               return TRUE;
+
+       memset(&info, 0x0, sizeof(TelSmsStatusInfo));
+       info.index = index;
+       info.status = status;
+
+       rsp_cb_data = dtapi_create_resp_cb_data(sms, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SMS_SET_MEMORY_STATUS,
+               &info, sizeof(TelSmsStatusInfo),
+               on_response_dtapi_sms_set_message_status, rsp_cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch Failed");
+               tcore_free(rsp_cb_data);
+       }
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_sms_interface(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin)
+{
+       TelephonySms *sms;
+
+       sms = telephony_sms_skeleton_new();
+       telephony_object_skeleton_set_sms(object, sms);
+       g_object_unref(sms);
+
+       dbg("sms: [%p]", sms);
+
+       g_signal_connect(sms,
+               "handle-send",
+               G_CALLBACK (dtapi_sms_send), plugin);
+       g_signal_connect(sms,
+               "handle-read-in-sim",
+               G_CALLBACK (dtapi_sms_read_in_sim), plugin);
+       g_signal_connect(sms,
+               "handle-write-in-sim",
+               G_CALLBACK (dtapi_sms_write_in_sim), plugin);
+       g_signal_connect(sms,
+               "handle-delete-in-sim",
+               G_CALLBACK (dtapi_sms_delete_in_sim), plugin);
+       g_signal_connect(sms,
+               "handle-get-count",
+               G_CALLBACK (dtapi_sms_get_count), plugin);
+       g_signal_connect(sms,
+               "handle-set-cb-config",
+               G_CALLBACK (dtapi_sms_set_cb_config), plugin);
+       g_signal_connect(sms,
+               "handle-get-cb-config",
+               G_CALLBACK (dtapi_sms_get_cb_config), plugin);
+       g_signal_connect(sms,
+               "handle-get-parameters",
+               G_CALLBACK (dtapi_sms_get_parameters), plugin);
+       g_signal_connect(sms,
+               "handle-set-parameters",
+               G_CALLBACK (dtapi_sms_set_parameters), plugin);
+       g_signal_connect(sms,
+               "handle-send-deliver-report",
+               G_CALLBACK (dtapi_sms_send_deliver_report), plugin);
+       g_signal_connect(sms,
+               "handle-set-sca",
+               G_CALLBACK (dtapi_sms_set_sca), plugin);
+       g_signal_connect(sms,
+               "handle-get-sca",
+               G_CALLBACK (dtapi_sms_get_sca), plugin);
+       g_signal_connect(sms,
+               "handle-set-memory-status",
+               G_CALLBACK (dtapi_sms_set_memory_status), plugin);
+       g_signal_connect(sms,
+               "handle-set-message-status",
+               G_CALLBACK (dtapi_sms_set_message_status), plugin);
+
+       /* Initialize D-Bus Properties */
+       telephony_sms_set_sim_memory_status(sms, FALSE);
+       telephony_sms_set_init_status(sms, FALSE);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_sms_notification(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin, TcoreNotification command,
+       guint data_len, const void *data)
+{
+       TelephonySms *sms;
+
+       tcore_check_return_value_assert(NULL != object, FALSE);
+
+       sms = telephony_object_peek_sms(TELEPHONY_OBJECT(object));
+       dbg("sms: [%p]", sms);
+
+       switch (command) {
+       case TCORE_NOTIFICATION_SMS_INCOM_MSG: {
+               const TelSmsDatapackageInfo *incoming_msg = data;
+               GVariant *sca = NULL;
+               GVariantBuilder sca_builder;
+               gchar *tpdu = NULL;
+
+               tcore_check_return_value_assert(NULL != incoming_msg, FALSE);
+
+               dbg("Incoming Message Notification RECEIVED");
+
+               dbg("TON: [%d] NPI: [%d] SCA: [%s] TPDU Length: [%d]",
+                       incoming_msg->sca.ton, incoming_msg->sca.npi,
+                       incoming_msg->sca.number, incoming_msg->tpdu_length);
+               g_variant_builder_init(&sca_builder, G_VARIANT_TYPE("a{sv}"));
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "ton", g_variant_new_byte(incoming_msg->sca.ton));
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "npi", g_variant_new_byte(incoming_msg->sca.npi));
+               g_variant_builder_add(&sca_builder, "{sv}",
+                       "number", g_variant_new_string(incoming_msg->sca.number));
+               sca = g_variant_builder_end(&sca_builder);
+
+               tpdu = g_base64_encode(&(incoming_msg->tpdu[0]), incoming_msg->tpdu_length);
+
+               telephony_sms_emit_incoming_msg(sms, sca, tpdu);
+               dbg("Emitted incoming Message");
+
+               tcore_free(tpdu);
+               dbg("Exit");
+       }
+       break;
+
+       case TCORE_NOTIFICATION_SMS_CB_INCOM_MSG: {
+               gchar *cb_data = NULL;
+               const TelSmsCbMsgInfo *cb_noti = data;
+
+               tcore_check_return_value_assert(NULL != cb_noti, FALSE);
+
+               dbg("Incoming CELL BROADCAST Message Notification RECEIVED");
+
+               cb_data = g_base64_encode(cb_noti->cb_data, cb_noti->length);
+
+               telephony_sms_emit_incoming_cb_msg(sms, cb_noti->cb_type, cb_data);
+               tcore_free(cb_data);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_SMS_ETWS_INCOM_MSG: {
+               gchar *etws_data = NULL;
+               const TelSmsEtwsMsgInfo *etws_noti = data;
+
+               tcore_check_return_value_assert(NULL != etws_noti, FALSE);
+
+               dbg("ETWS Message Notification RECEIVED");
+
+               etws_data = g_base64_encode(etws_noti->etws_data, etws_noti->length);
+
+               telephony_sms_emit_incoming_etws_msg(sms, etws_noti->etws_type, etws_data);
+               tcore_free(etws_data);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_SMS_MEMORY_STATUS: {
+               tcore_check_return_value_assert(NULL != data, FALSE);
+
+               const gboolean memory_status = *(gboolean *)data;
+               dbg("Memory Status Notification RECEIVED");
+
+               /* Update Property */
+               telephony_sms_set_sim_memory_status(sms, memory_status);
+       }
+       break;
+
+       case TCORE_NOTIFICATION_SMS_DEVICE_READY: {
+               tcore_check_return_value_assert(NULL != data, FALSE);
+
+               const gboolean init_status = *(gboolean *)data;
+               dbg("Device Ready Notification RECEIVED");
+
+               /* Update Property */
+               telephony_sms_set_init_status(sms, init_status);
+       }
+       break;
+
+       default:
+               err("Unsupported Notification [0x%x]", command);
+       break;
+       }
+
+       return TRUE;
+}
diff --git a/src/dtapi_ss.c b/src/dtapi_ss.c
new file mode 100644 (file)
index 0000000..082dd67
--- /dev/null
@@ -0,0 +1,810 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_ss.h"
+#include "dtapi_util.h"
+
+#include <appsvc.h>
+#include <bundle.h>
+#include <plugin.h>
+#include <tel_ss.h>
+
+#define AC_SS          "telephony_framework::api_ss"
+#define MAX_SS_USSD_LEN 208
+
+typedef struct{
+       int status;
+       guint length;
+       char data[MAX_SS_USSD_LEN + 1];
+} CissDataType;
+
+static void _launch_ciss(const TelSsUssdNoti *ussd)
+{
+       gchar *encoded_data;
+       CissDataType ciss_data;
+
+       tcore_check_return_assert(NULL != ussd);
+       bundle *kb = bundle_create();
+       if (!kb) {
+               err("bundle_create() failed");
+               return;
+       }
+
+       memset(&ciss_data, 0x00, sizeof(CissDataType));
+       ciss_data.status = ussd->status;
+
+       if(NULL == ussd->str) {
+               err("Empty USSD string");
+               bundle_free(kb);
+               return;
+       }
+       ciss_data.length = strlen((const char*)ussd->str);
+       if(ciss_data.length > MAX_SS_USSD_LEN) {
+               err("USSD data length is more, Unable to launch ciss");
+               bundle_free(kb);
+               return;
+       }
+       g_strlcpy(ciss_data.data, (gchar *)ussd->str, MAX_SS_USSD_LEN + 1);
+
+       dbg("launch ciss application by appsvc");
+       appsvc_set_operation(kb, "http://tizen.org/appcontrol/operation/ciss");
+       appsvc_set_pkgname(kb, "com.samsung.ciss");
+
+       encoded_data = g_base64_encode((guchar *)&ciss_data, sizeof(CissDataType));
+       appsvc_add_data(kb, "CISS_LAUNCHING_MODE", "RESP");
+       appsvc_add_data(kb, "KEY_EVENT_TYPE", "100");
+       appsvc_add_data(kb, "KEY_ENCODED_DATA", encoded_data);
+
+       dbg("ciss appsvc run");
+       appsvc_run_service(kb, 0, NULL, NULL);
+
+       bundle_free(kb);
+       g_free(encoded_data);
+}
+
+static void on_response_dtapi_ss_set_barring(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+
+       dbg("Barring set response result: [%d]", result);
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       telephony_ss_complete_set_barring(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_set_barring(TelephonySs *ss,
+       GDBusMethodInvocation *invocation, gint class,
+       gboolean enable, gint type, const gchar *pwd,
+       gpointer user_data)
+{
+       TelSsBarringInfo req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "x") == FALSE)
+               return TRUE;
+
+       req.class = class;
+       req.enable = enable;
+       req.type = type;
+       g_strlcpy(req.pwd, pwd, TEL_SS_BARRING_PASSWORD_LEN_MAX + 1 );
+       dbg("barring password: [%s] class: [%d], barring type: [%d]", req.pwd, req.class, req.type);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_SET_BARRING,
+               &req, sizeof(TelSsBarringInfo),
+               on_response_dtapi_ss_set_barring, cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_get_barring_status(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+       GVariant *records = NULL;
+       GVariantBuilder builder;
+       guint count = 0;
+
+       dbg("Barring get status response result: [%d]", result);
+
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               const TelSsBarringResp *resp = data;
+               tcore_check_return_assert(NULL != resp);
+
+               dbg("Barring status List count: [%d]", resp->record_num);
+               for (count = 0; count < resp->record_num; count++) {
+                       g_variant_builder_open(&builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&builder, "{sv}",
+                               "class", g_variant_new_int32(resp->records[count].class));
+                       g_variant_builder_add(&builder, "{sv}",
+                               "enable", g_variant_new_boolean(resp->records[count].enable));
+                       g_variant_builder_add(&builder, "{sv}",
+                               "type", g_variant_new_int32(resp->records[count].type));
+
+                       g_variant_builder_close(&builder);
+
+                       dbg("[%d] : Class: [%d] Enable: [%s] Type: [%d]", count,
+                               resp->records[count].class,
+                               (resp->records[count].enable ? "YES" : "NO"),
+                               resp->records[count].type);
+               }
+       }
+       records = g_variant_builder_end(&builder);
+
+       telephony_ss_complete_get_barring_status(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result, count, records);
+       g_variant_unref(records);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_get_barring_status(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       gint class, gint type, gpointer user_data)
+{
+       TelSsBarringGetInfo req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "r") == FALSE)
+               return TRUE;
+
+       req.class = class;
+       req.type = type;
+
+       dbg("class: %d, type: %d", req.class, req.type);
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_GET_BARRING_STATUS,
+               &req, sizeof(TelSsBarringGetInfo),
+               on_response_dtapi_ss_get_barring_status, cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_change_barring_password(
+       gint result, const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+
+       dbg("Barring change password response result: [%d]", result);
+
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       telephony_ss_complete_change_barring_password(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_change_barring_password(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       const gchar *old_pwd, const gchar *new_pwd,
+       gpointer user_data)
+{
+       TelSsBarringPwdInfo req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "x") == FALSE)
+               return TRUE;
+
+       g_strlcpy(req.old_pwd, old_pwd, TEL_SS_BARRING_PASSWORD_LEN_MAX + 1);
+       g_strlcpy(req.new_pwd, new_pwd, TEL_SS_BARRING_PASSWORD_LEN_MAX + 1);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_CHANGE_BARRING_PASSWORD,
+               &req, sizeof(TelSsBarringPwdInfo),
+               on_response_dtapi_ss_change_barring_password, cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_set_forwarding(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+
+       dbg("Forwarding set response result: [%d]", result);
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       telephony_ss_complete_set_forwarding(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_set_forwarding(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       gint class, gint mode, gint condition,
+       const gchar *number, gint wait_time,
+       gpointer user_data)
+{
+       TelSsForwardInfo req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "x") == FALSE)
+               return TRUE;
+
+       req.class = class;
+       req.mode = mode;
+       req.condition = condition;
+       req.wait_time = wait_time;
+       g_strlcpy(req.number, number, TEL_SS_NUMBER_LEN_MAX + 1);
+
+       dbg("class: %d, mode: %d, condition: %d,  wait_time: %d, number: %s",
+                       req.class, req.mode, req.condition, req.wait_time, req.number);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_SET_FORWARDING,
+               &req, sizeof(TelSsForwardInfo),
+               on_response_dtapi_ss_set_forwarding, cb_data);
+       if (result != TEL_RETURN_SUCCESS ) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_get_forwarding_status(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+       GVariant *records = NULL;
+       GVariantBuilder builder;
+       guint count = 0;
+
+       dbg("Forwarding get status response result: [%d]", result);
+
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SIM_RESULT_SUCCESS) {
+               const TelSsForwardingResp *resp = data;
+               tcore_check_return_assert(NULL != resp);
+
+               dbg("Forwarding status List count: [%d]", resp->record_num);
+               for (count = 0; count < resp->record_num; count++) {
+                       g_variant_builder_open(&builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&builder, "{sv}",
+                               "class", g_variant_new_int32(resp->records[count].class));
+                       g_variant_builder_add(&builder, "{sv}",
+                               "enable", g_variant_new_boolean(resp->records[count].enable));
+                       g_variant_builder_add(&builder, "{sv}",
+                               "condition", g_variant_new_int32(resp->records[count].condition));
+                       g_variant_builder_add(&builder, "{sv}",
+                               "number", g_variant_new_string(resp->records[count].number));
+                       g_variant_builder_add(&builder, "{sv}",
+                               "wait_time", g_variant_new_int32(resp->records[count].wait_time));
+
+                       g_variant_builder_close(&builder);
+
+                       dbg("[%d] : Class: [%d] Enable: [%s] Condition: [%d] "\
+                               "Number: [%s] Wait time: [%d]", count,
+                               resp->records[count].class,
+                               (resp->records[count].enable ? "YES" : "NO"),
+                               resp->records[count].condition,
+                               resp->records[count].number,
+                               resp->records[count].wait_time);
+               }
+       }
+       records = g_variant_builder_end(&builder);
+
+       telephony_ss_complete_get_forwarding_status(resp_cb_data->interface_object,
+                       resp_cb_data->invocation, result, count, records);
+
+       g_variant_unref(records);
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_get_forwarding_status(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       gint class, gint condition, gpointer user_data)
+{
+       TelSsForwardGetInfo req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "r") == FALSE)
+               return TRUE;
+
+       req.class = class;
+       req.condition = condition;
+       dbg("class: %d, condition: %d", req.class, req.condition);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_GET_FORWARDING_STATUS,
+               &req, sizeof(TelSsForwardGetInfo),
+               on_response_dtapi_ss_get_forwarding_status, cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_set_waiting(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+
+       dbg("Waiting set response result: [%d]", result);
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       telephony_ss_complete_set_waiting(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_set_waiting(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       gint class, gboolean enable, gpointer user_data)
+{
+       TelSsWaitingInfo req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "x") == FALSE)
+               return TRUE;
+
+       req.class = class;
+       req.enable = enable;
+       dbg("class: %d, enable: %d", req.class, req.enable);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_SET_WAITING,
+               &req, sizeof(TelSsWaitingInfo),
+               on_response_dtapi_ss_set_waiting, cb_data);
+       if (result != TEL_RETURN_SUCCESS ) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_get_waiting_status(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+       GVariant *records = NULL;
+       GVariantBuilder builder;
+       guint count = 0;
+
+       dbg("Waiting get status response result: [%d]", result);
+
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       g_variant_builder_init(&builder, G_VARIANT_TYPE("aa{sv}"));
+       if (result == TEL_SS_RESULT_SUCCESS) {
+               const TelSsWaitingResp *resp = data;
+               tcore_check_return_assert(NULL != resp);
+
+               dbg("Waiting status List count: [%d]", resp->record_num);
+               for (count = 0; count < resp->record_num; count++) {
+                       g_variant_builder_open(&builder, G_VARIANT_TYPE("a{sv}"));
+
+                       g_variant_builder_add(&builder, "{sv}",
+                               "class", g_variant_new_int32(resp->records[count].class));
+                       g_variant_builder_add(&builder, "{sv}",
+                               "enable", g_variant_new_boolean(resp->records[count].enable));
+
+                       g_variant_builder_close(&builder);
+
+                       dbg("[%d] : Class: [%d] Enable: [%s]", count,
+                               resp->records[count].class,
+                               (resp->records[count].enable ? "YES" : "NO"));
+               }
+       }
+       records = g_variant_builder_end(&builder);
+
+       telephony_ss_complete_get_waiting_status(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result, count, records);
+       g_variant_unref(records);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_get_waiting_status(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       gint class, gpointer user_data)
+{
+       TelSsClass req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "r") == FALSE)
+               return TRUE;
+
+       req = class;
+       dbg("class: %d", req);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_GET_WAITING_STATUS,
+               &req, sizeof(TelSsClass),
+               on_response_dtapi_ss_get_waiting_status, cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_set_cli(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+
+       dbg("CLI set response result: [%d]", result);
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       telephony_ss_complete_set_cli(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_set_cli(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       gint type, gint status, gpointer user_data)
+{
+       TelSsCliInfo req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "x") == FALSE)
+               return TRUE;
+
+       req.type = type;
+       switch(req.type){
+       case TEL_SS_CLI_CLIR:
+               req.status.clir = status;
+               break;
+       case TEL_SS_CLI_CLIP:
+               req.status.clip = status;
+               break;
+       case TEL_SS_CLI_COLP:
+               req.status.colp = status;
+               break;
+       case TEL_SS_CLI_COLR:
+               req.status.colr = status;
+               break;
+       case TEL_SS_CLI_CDIP:
+               req.status.cdip = status;
+               break;
+       case TEL_SS_CLI_CNAP:
+               req.status.cnap = status;
+               break;
+       }
+
+       dbg("type: %d status: %d", req.type, status);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_SET_CLI,
+               &req, sizeof(TelSsCliInfo),
+               on_response_dtapi_ss_set_cli, cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_get_cli_status(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+
+       const TelSsCliResp *resp = data;
+       gint net_status,dev_status;
+
+       dbg("CLI get status response result: [%d]", result);
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       if (result != TEL_RETURN_SUCCESS) {
+               telephony_ss_complete_get_cli_status(resp_cb_data->interface_object,
+                       resp_cb_data->invocation, result, -1, -1, -1);
+               tcore_free(resp_cb_data);
+               return;
+       }
+
+       tcore_check_return_assert(NULL != resp);
+
+       switch(resp->type){
+       case TEL_SS_CLI_CLIR:
+               net_status = resp->status.clir.net_status;
+               dev_status = resp->status.clir.dev_status;
+       break;
+
+       case TEL_SS_CLI_CLIP:
+               net_status = resp->status.clip.net_status;
+               dev_status = resp->status.clip.dev_status;
+       break;
+
+       case TEL_SS_CLI_COLP:
+               net_status = resp->status.colp.net_status;
+               dev_status = resp->status.colp.dev_status;
+       break;
+
+       case TEL_SS_CLI_COLR:
+               net_status = resp->status.colr.net_status;
+               dev_status = resp->status.colr.dev_status;
+       break;
+
+       case TEL_SS_CLI_CDIP:
+               net_status = resp->status.cdip.net_status;
+               dev_status = resp->status.cdip.dev_status;
+       break;
+
+       case TEL_SS_CLI_CNAP:
+               net_status = resp->status.cnap.net_status;
+               dev_status = resp->status.cnap.dev_status;
+       break;
+
+       default :
+               net_status = -1;
+               dev_status = -1;
+               result = TEL_SS_RESULT_FAILURE;
+       break;
+       }
+
+       telephony_ss_complete_get_cli_status(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result,
+               resp->type, net_status, dev_status);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_get_cli_status(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       gint type, gpointer user_data)
+{
+       TelSsCliType req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "r") == FALSE)
+               return TRUE;
+
+       req = type;
+       dbg("type: [%d]", req);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_GET_CLI_STATUS,
+               &req, sizeof(TelSsCliType),
+               on_response_dtapi_ss_get_cli_status, cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+
+       return TRUE;
+}
+
+static void on_response_dtapi_ss_send_ussd_request(gint result,
+       const void *data, void *cb_data)
+{
+       DbusRespCbData *resp_cb_data = cb_data;
+
+       const TelSsUssdResp *resp = data;
+
+       dbg("Send USSD response result: [%d]", result);
+       tcore_check_return_assert(NULL != resp_cb_data);
+
+       if (result != TEL_RETURN_SUCCESS) {
+               telephony_ss_complete_send_ussd_request(resp_cb_data->interface_object,
+                       resp_cb_data->invocation, result, -1, -1, NULL);
+               tcore_free(resp_cb_data);
+               return;
+       }
+
+       tcore_check_return_assert(NULL != resp);
+
+       telephony_ss_complete_send_ussd_request(resp_cb_data->interface_object,
+               resp_cb_data->invocation, result,
+               resp->type, resp->status, (const gchar *)resp->str);
+
+       tcore_free(resp_cb_data);
+}
+
+static gboolean dtapi_ss_send_ussd_request(TelephonySs *ss,
+       GDBusMethodInvocation *invocation,
+       gint type, const gchar *str, gpointer user_data)
+{
+       TelSsUssdInfo req;
+       TelReturn result;
+       TcorePlugin *plugin = user_data;
+       DbusRespCbData *cb_data = NULL;
+
+       if (dtapi_check_access_control(invocation, AC_SS, "x") == FALSE)
+               return TRUE;
+
+       req.type = type;
+       req.str = (unsigned char*)tcore_strdup(str);
+       dbg("type: %d, string: %s", req.type, req.str);
+
+       cb_data = dtapi_create_resp_cb_data(ss, invocation, NULL, 0);
+
+       result = tcore_plugin_dispatch_request(plugin, TRUE,
+               TCORE_COMMAND_SS_SEND_USSD_REQUEST,
+               &req, sizeof(TelSsUssdInfo),
+               on_response_dtapi_ss_send_ussd_request, cb_data);
+       if (result != TEL_RETURN_SUCCESS) {
+               dtapi_return_error(invocation, G_DBUS_ERROR_FAILED, "Dispatch failed");
+               tcore_free(cb_data);
+       }
+       tcore_free(req.str);
+
+       return TRUE;
+}
+
+gboolean dtapi_setup_ss_interface(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin)
+{
+       TelephonySs *ss;
+
+       tcore_check_return_value_assert(NULL != object, FALSE);
+       tcore_check_return_value_assert(NULL != plugin, FALSE);
+
+       ss = telephony_ss_skeleton_new();
+       telephony_object_skeleton_set_ss(object, ss);
+       g_object_unref(ss);
+
+       tcore_check_return_value_assert(NULL != ss, FALSE);
+       dbg("ss: [%p]", ss);
+
+       g_signal_connect (ss,
+               "handle-set-barring",
+               G_CALLBACK (dtapi_ss_set_barring),
+               plugin);
+
+       g_signal_connect (ss,
+               "handle-get-barring-status",
+               G_CALLBACK (dtapi_ss_get_barring_status),
+               plugin);
+
+       g_signal_connect (ss,
+               "handle-change-barring-password",
+               G_CALLBACK (dtapi_ss_change_barring_password),
+               plugin);
+
+
+       g_signal_connect (ss,
+               "handle-set-forwarding",
+               G_CALLBACK (dtapi_ss_set_forwarding),
+               plugin);
+
+       g_signal_connect (ss,
+               "handle-get-forwarding-status",
+               G_CALLBACK (dtapi_ss_get_forwarding_status),
+               plugin);
+
+       g_signal_connect (ss,
+               "handle-set-waiting",
+               G_CALLBACK (dtapi_ss_set_waiting),
+               plugin);
+
+       g_signal_connect (ss,
+               "handle-get-waiting-status",
+               G_CALLBACK (dtapi_ss_get_waiting_status),
+               plugin);
+
+       g_signal_connect (ss,
+               "handle-set-cli",
+               G_CALLBACK (dtapi_ss_set_cli),
+               plugin);
+
+       g_signal_connect (ss,
+               "handle-get-cli-status",
+               G_CALLBACK (dtapi_ss_get_cli_status),
+               plugin);
+
+       g_signal_connect (ss,
+               "handle-send-ussd-request",
+               G_CALLBACK (dtapi_ss_send_ussd_request),
+               plugin);
+
+       return TRUE;
+}
+
+gboolean dtapi_handle_ss_notification(TelephonyObjectSkeleton *object,
+       TcorePlugin *plugin, TcoreNotification command,
+       guint data_len, const void *data)
+{
+       TelephonySs *ss;
+
+       tcore_check_return_value_assert(NULL != object, FALSE);
+       tcore_check_return_value_assert(NULL != plugin, FALSE);
+
+       ss = telephony_object_peek_ss(TELEPHONY_OBJECT(object));
+       tcore_check_return_value_assert(NULL != ss, FALSE);
+       dbg("ss: [%p]", ss);
+
+       switch (command) {
+       case TCORE_NOTIFICATION_SS_USSD: {
+               TelSsUssdNoti *ussd = (TelSsUssdNoti *)data;
+               tcore_check_return_value_assert(NULL != ussd, FALSE);
+
+               telephony_ss_emit_notify_ussd(ss, ussd->status,
+                               (const gchar*)ussd->str);
+
+               /* Launch CISS application */
+               _launch_ciss(ussd);
+       }
+       break;
+
+       default:
+               err("Unsupported notification: [0x%x]", command);
+       break;
+       }
+       return TRUE;
+}
diff --git a/src/dtapi_util.c b/src/dtapi_util.c
new file mode 100644 (file)
index 0000000..a09b2a0
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 "dtapi_util.h"
+
+#include <security-server.h>
+
+GVariant *dtapi_create_empty_variant(const gchar *format_string)
+{
+       GVariantBuilder builder;
+
+       g_variant_builder_init(&builder, G_VARIANT_TYPE(format_string));
+       return g_variant_builder_end(&builder);
+}
+
+inline DbusRespCbData *dtapi_create_resp_cb_data(void *interface_object,
+       GDBusMethodInvocation *invocation, void *user_data, unsigned int ud_len)
+{
+       DbusRespCbData *rsp_cb_data = tcore_malloc0(sizeof(DbusRespCbData) + ud_len);
+       rsp_cb_data->interface_object = interface_object;
+       rsp_cb_data->invocation = invocation;
+       if ((user_data != NULL) && (ud_len > 0))
+               memcpy(rsp_cb_data->user_data, user_data, ud_len);
+       return rsp_cb_data;
+}
+
+inline const char *dtapi_get_cp_name_by_object_path(const char *object_path)
+{
+       if (!object_path)
+               return NULL;
+
+       if (!g_str_has_prefix(object_path, TELEPHONY_OBJECT_PATH)) {
+               return NULL;
+       }
+
+       return object_path + strlen(TELEPHONY_OBJECT_PATH) + 1;
+}
+
+gboolean dtapi_check_access_control(GDBusMethodInvocation *invoc,
+       const char *label, const char *perm)
+{
+       GDBusConnection *conn;
+       GVariant *result_pid;
+       GVariant *param;
+       GError *error = NULL;
+       const char *sender;
+       unsigned int pid;
+       int ret;
+       int result = FALSE;
+
+       conn = g_dbus_method_invocation_get_connection(invoc);
+       if (conn == NULL) {
+               err("access control denied(no connection info)");
+               goto OUT;
+       }
+
+       sender = g_dbus_method_invocation_get_sender(invoc);
+       dbg("sender: %s", sender);
+
+       param = g_variant_new("(s)", sender);
+       if (param == NULL) {
+               err("access control denied(sender info fail)");
+               goto OUT;
+       }
+
+       result_pid = g_dbus_connection_call_sync (conn, "org.freedesktop.DBus",
+                               "/org/freedesktop/DBus",
+                               "org.freedesktop.DBus",
+                               "GetConnectionUnixProcessID",
+                               param, NULL,
+                               G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
+
+       if (error) {
+               err("access control denied (dbus error: %d(%s))",
+                                       error->code, error->message);
+               g_error_free (error);
+               goto OUT;
+       }
+
+       if (result_pid == NULL) {
+               err("access control denied(fail to get pid)");
+               goto OUT;
+       }
+
+       g_variant_get(result_pid, "(u)", &pid);
+       g_variant_unref(result_pid);
+
+       dbg ("pid = %u", pid);
+
+       ret = security_server_check_privilege_by_pid(pid, label, perm);
+       if (ret != SECURITY_SERVER_API_SUCCESS) {
+#ifdef ENABLE_CHECK_PRIVILEGE
+               err("access control(%s - %s) denied(%d)", label, perm, ret);
+#else
+               dbg("access control(%s - %s) denied(%d)", label, perm, ret);
+               result = TRUE;
+#endif
+       }
+       else
+               result = TRUE;
+
+OUT:
+
+       if (!result)
+               dtapi_return_error(invoc, G_DBUS_ERROR_ACCESS_DENIED, "Access denied");
+
+       return result;
+}
similarity index 66%
rename from src/common.c
rename to src/legacy/common.c
index a9d6ba9..270fdb6 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #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)
+const char *dbus_plugin_get_cp_name_by_object_path(const char *object_path)
 {
        if (!object_path)
                return NULL;
 
-       if (!g_str_has_prefix(object_path, MY_DBUS_PATH)) {
+       if (!g_str_has_prefix(object_path, TELEPHONY_OBJECT_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;
+       return object_path + strlen(TELEPHONY_OBJECT_PATH) + 1;
 }
 
 gboolean check_access_control(GDBusMethodInvocation *invoc, const char *label,
diff --git a/src/legacy/common.h b/src/legacy/common.h
new file mode 100644 (file)
index 0000000..c85c051
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+
+#include "generated-code.h"
+
+#define AC_MANAGER     "telephony_framework::api_manager"
+#define AC_CALL                "telephony_framework::api_call"
+#define AC_GPS         "telephony_framework::api_gps"
+#define AC_MODEM       "telephony_framework::api_modem"
+#define AC_NETWORK     "telephony_framework::api_network"
+#define AC_PHONEBOOK   "telephony_framework::api_phonebook"
+#define AC_SAP         "telephony_framework::api_sap"
+#define AC_SAT         "telephony_framework::api_sat"
+#define AC_SIM         "telephony_framework::api_sim"
+#define AC_SMS         "telephony_framework::api_sms"
+#define AC_SS          "telephony_framework::api_ss"
+
+struct custom_data {
+       TcorePlugin *plugin;
+       Communicator *comm;
+       Server *server;
+       guint bus_id;
+
+       GHashTable *objects;
+       GDBusObjectManagerServer *manager;
+};
+
+typedef struct {
+       void *interface_object;
+       GDBusMethodInvocation *invocation;
+       char user_data[0]; /* Additional user data base pointer */
+} DbusRespCbData;
+
+#define GET_CP_NAME(invocation) dbus_plugin_get_cp_name_by_object_path(g_dbus_method_invocation_get_object_path(invocation))
+#define MAKE_DBUS_RESP_CB_DATA(data, object, invocation, user_data, user_data_len)  \
+       data = g_malloc0(sizeof(DbusRespCbData) + user_data_len); \
+       data->interface_object = object; \
+       data->invocation = invocation; \
+       if ((user_data != NULL) && (user_data_len > 0)) \
+               memcpy(data->user_data, user_data, user_data_len);
+
+#define FREE_DBUS_RESP_CB_DATA(data)  g_free(data);
+
+const char *dbus_plugin_get_cp_name_by_object_path(const char *object_path);
+gboolean check_access_control(GDBusMethodInvocation *invoc, const char *label, const char *perm);
+
+gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_network_notification(struct custom_data *ctx, CoreObject *source, 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_notification(struct custom_data *ctx, CoreObject *source, 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_notification(struct custom_data *ctx, CoreObject *source, 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_notification(struct custom_data *ctx, CoreObject *source, 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_notification(struct custom_data *ctx, CoreObject *source, 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_notification(struct custom_data *ctx, CoreObject *source, 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_notification(struct custom_data *ctx, CoreObject *source, 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_notification(struct custom_data *ctx, CoreObject *source, 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_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+gboolean dbus_plugin_setup_gps_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
+gboolean dbus_plugin_gps_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
+
+#endif
similarity index 97%
rename from src/gps.c
rename to src/legacy/gps.c
index 86e5eff..c861361 100644 (file)
--- a/src/gps.c
@@ -1,7 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 98%
rename from src/modem.c
rename to src/legacy/modem.c
index dad67dc..bdb3315 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/network.c
rename to src/legacy/network.c
index 3bfb24f..4f26f17 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/phonebook.c
rename to src/legacy/phonebook.c
index 9b21f10..4323363 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sap.c
rename to src/legacy/sap.c
index d7e39d8..6933c72 100644 (file)
--- a/src/sap.c
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sat.c
rename to src/legacy/sat.c
index 353491e..77e5086 100644 (file)
--- a/src/sat.c
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sat_manager.c
rename to src/legacy/sat_manager.c
index 9a99a41..c848d15 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1210,7 +1209,7 @@ GVariant* sat_manager_send_ussd_noti(struct custom_data *ctx, const char *plugin
        GVariant *send_ussd = NULL;
        struct sat_manager_queue_data q_data;
 
-       gint command_id = 0;    
+       gint command_id = 0;
        gushort text_len = 0, ussd_str_len = 0;
        gchar text[SAT_TEXT_STRING_LEN_MAX], ussd_string[SAT_USSD_STRING_LEN_MAX];
        GVariant *icon_id = NULL;
@@ -4174,10 +4173,10 @@ static gboolean _sat_manager_handle_setup_call_confirm(struct custom_data *ctx,
 
                        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
                        if (plg_name) {
-                               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+                               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
                        }
                        else {
-                               path = g_strdup_printf("%s", MY_DBUS_PATH);
+                               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
                        }
                        dbg("path = [%s]", path);
 
@@ -4322,9 +4321,9 @@ static gboolean _sat_manager_handle_launch_browser_confirm(struct custom_data *c
 
                        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
                        if (plg_name) {
-                               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+                               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
                        } else {
-                               path = g_strdup_printf("%s", MY_DBUS_PATH);
+                               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
                        }
                        dbg("path = [%s]", path);
 
@@ -4418,9 +4417,9 @@ static gboolean _sat_manager_handle_open_channel_confirm(struct custom_data *ctx
                        //emit send_dtmf signal
                        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
                        if (plg_name) {
-                               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+                               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
                        } else {
-                               path = g_strdup_printf("%s", MY_DBUS_PATH);
+                               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
                        }
                        dbg("path = [%s]", path);
 
@@ -4570,10 +4569,10 @@ static gboolean _sat_manager_handle_play_tone_ui_display_status(struct custom_da
        //emit play tone signal
        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
-               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
        }
        else {
-               path = g_strdup_printf("%s", MY_DBUS_PATH);
+               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
        }
        dbg("path = [%s]", path);
 
@@ -4629,10 +4628,10 @@ static gboolean _sat_manager_handle_send_sms_ui_display_status(struct custom_dat
        //emit send sms signal
        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
-               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
        }
        else {
-               path = g_strdup_printf("%s", MY_DBUS_PATH);
+               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
        }
        dbg("path = [%s]", path);
 
@@ -4689,10 +4688,10 @@ static gboolean _sat_manager_handle_send_ss_ui_display_status(struct custom_data
        //emit send ss signal
        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
-               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
        }
        else {
-               path = g_strdup_printf("%s", MY_DBUS_PATH);
+               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
        }
        dbg("path = [%s]", path);
 
@@ -4748,10 +4747,10 @@ static gboolean _sat_manager_handle_send_ussd_ui_display_status(struct custom_da
        /* emit send ussd signal */
        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
-               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
        }
        else {
-               path = g_strdup_printf("%s", MY_DBUS_PATH);
+               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
        }
        dbg("path = [%s]", path);
 
@@ -4876,9 +4875,9 @@ static gboolean _sat_manager_handle_send_dtmf_ui_display_status(struct custom_da
        //emit send_dtmf signal
        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
-               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
        } else {
-               path = g_strdup_printf("%s", MY_DBUS_PATH);
+               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
        }
        dbg("path = [%s]", path);
 
@@ -4935,9 +4934,9 @@ static gboolean _sat_manager_handle_open_channel_ui_display_status(struct custom
        //emit send_dtmf signal
        plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
-               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
+               path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
        } else {
-               path = g_strdup_printf("%s", MY_DBUS_PATH);
+               path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
        }
        dbg("path = [%s]", path);
 
@@ -5090,7 +5089,6 @@ gboolean sat_manager_update_language(struct custom_data *ctx, const char *plugin
 {
        Server *s = NULL;
        TcorePlugin *plg = NULL;
-       gpointer handle = NULL;
        static Storage *strg;
 
        TReturn rv = TCORE_RETURN_FAILURE;
@@ -5104,11 +5102,6 @@ gboolean sat_manager_update_language(struct custom_data *ctx, const char *plugin
 
        s = ctx->server;
        strg = tcore_server_find_storage(s, "vconf");
-       handle = tcore_storage_create_handle(strg, "vconf");
-       if (!handle){
-               err("fail to create vconf handle");
-               return result;
-       }
 
        plg = tcore_server_find_plugin(ctx->server, plugin_name);
        if (!plg){
similarity index 98%
rename from src/sat_manager.h
rename to src/legacy/sat_manager.h
index b8503ee..db709f4 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sat_ui_support/TelCall.h
rename to src/legacy/sat_ui_support/TelCall.h
index eafdf9e..f12e558 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 92%
rename from src/sat_ui_support/TelDefines.h
rename to src/legacy/sat_ui_support/TelDefines.h
index 8badfbc..414e8bb 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 98%
rename from src/sat_ui_support/TelErr.h
rename to src/legacy/sat_ui_support/TelErr.h
index 2567817..ffb00fd 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sat_ui_support/TelSat.h
rename to src/legacy/sat_ui_support/TelSat.h
index 237b19f..d107329 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 98%
rename from src/sat_ui_support/TelSatEnvelope.h
rename to src/legacy/sat_ui_support/TelSatEnvelope.h
index 32903ca..3ba9015 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sat_ui_support/TelSatObj.h
rename to src/legacy/sat_ui_support/TelSatObj.h
index bda3eaf..93c2045 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sat_ui_support/TelSatProactvCmd.h
rename to src/legacy/sat_ui_support/TelSatProactvCmd.h
index 545b093..9446c54 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sat_ui_support/TelSim.h
rename to src/legacy/sat_ui_support/TelSim.h
index dde946a..a9e98d2 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/sat_ui_support/TelSs.h
rename to src/legacy/sat_ui_support/TelSs.h
index baff9f7..4940838 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 97%
rename from src/sat_ui_support/sat_ui_support.c
rename to src/legacy/sat_ui_support/sat_ui_support.c
index aeeb961..8192cda 100644 (file)
@@ -1,3 +1,21 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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>
similarity index 63%
rename from src/sat_ui_support/sat_ui_support.h
rename to src/legacy/sat_ui_support/sat_ui_support.h
index c2e3977..d409f6b 100644 (file)
@@ -1,3 +1,21 @@
+/*
+ * tel-plugin-dbus_tapi
+ *
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * 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 SAT_UI_SUPPORT_H_
 #define SAT_UI_SUPPORT_H_
 
similarity index 99%
rename from src/sat_util.c
rename to src/legacy/sat_util.c
index 0e2e11b..6678237 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 95%
rename from src/sim.c
rename to src/legacy/sim.c
index 155cb64..91b74be 100644 (file)
--- a/src/sim.c
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include "generated-code.h"
 #include "common.h"
 
+
+static gboolean dbus_sim_data_request(struct custom_data *ctx, enum tel_sim_status sim_status,
+                                       const char *plugin_name)
+{
+       UserRequest *ur = NULL;
+
+       switch(sim_status){
+               case SIM_STATUS_INITIALIZING :
+               case SIM_STATUS_PIN_REQUIRED :
+               case SIM_STATUS_PUK_REQUIRED :
+               case SIM_STATUS_CARD_BLOCKED :
+               case SIM_STATUS_NCK_REQUIRED :
+               case SIM_STATUS_NSCK_REQUIRED :
+               case SIM_STATUS_SPCK_REQUIRED :
+               case SIM_STATUS_CCK_REQUIRED :
+               case SIM_STATUS_LOCK_REQUIRED :
+                       if(ctx->sim_recv_first_status == FALSE) {
+                               int rv = 0;
+                               dbg("received sim status at first time");
+
+                               dbg("req - TREQ_SIM_GET_ECC ");
+                               ur = tcore_user_request_new(ctx->comm, plugin_name);
+                               tcore_user_request_set_command(ur, TREQ_SIM_GET_ECC);
+                               rv = tcore_communicator_dispatch_request(ctx->comm, ur);
+                               if(rv != TCORE_RETURN_SUCCESS) {
+                                       dbg("dispatch_request failed. return value = %d", rv);
+                               }
+                               ctx->sim_recv_first_status = TRUE;
+                       }
+                       break;
+
+               default :
+                       break;
+       }
+       return TRUE;
+}
+
 static gboolean on_sim_get_init_status(TelephonySim *sim, GDBusMethodInvocation *invocation,
                gpointer user_data)
 {
@@ -129,6 +165,7 @@ static gboolean on_sim_get_ecc(TelephonySim *sim, GDBusMethodInvocation *invocat
 {
        struct custom_data *ctx = user_data;
        GVariant *gv = NULL;
+       GVariantBuilder b;
        int i;
 
        if (check_access_control(invocation, AC_SIM, "r") == FALSE)
@@ -136,38 +173,21 @@ static gboolean on_sim_get_ecc(TelephonySim *sim, GDBusMethodInvocation *invocat
 
        dbg("Func Entrance");
 
-        if (ctx->cached_sim_ecc.ecc_count == 0) {
-               UserRequest *ur = NULL;
-               TReturn ret;
-
-               dbg("ecc_count is 0. Request to modem");
+       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-               ur = MAKE_UR(ctx, sim, invocation);
-               tcore_user_request_set_command(ur, TREQ_SIM_GET_ECC);
-               ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-               if (ret != TCORE_RETURN_SUCCESS) {
-                       telephony_sim_complete_get_ecc(sim, invocation, gv);
-                       tcore_user_request_unref(ur);
-               }
-       } else {
-               GVariantBuilder b;
-
-               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);
+       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);
 
-               if (!gv)
-                       dbg("error - ecc gv is NULL");
+       if (!gv)
+               dbg("error - ecc gv is NULL");
 
-               telephony_sim_complete_get_ecc(sim, invocation, gv);
-               g_variant_unref(gv);
-       }
+       telephony_sim_complete_get_ecc(sim, invocation, gv);
 
        return TRUE;
 }
@@ -1310,42 +1330,10 @@ gboolean dbus_plugin_sim_response(struct custom_data *ctx, UserRequest *ur,
        dbg("Command = [0x%x], data_len = %d", command, data_len);
 
        switch (command) {
-               case TRESP_SIM_GET_ECC: {
-                       GVariant *gv;
-                       GVariantBuilder b;
-                       int i;
-
+               case TRESP_SIM_GET_ECC:
                        dbg("resp comm - TRESP_SIM_GET_ECC");
-
-                       if (resp_read == NULL) {
-                               err("resp_read is NULL");
-                               telephony_sim_complete_get_ecc(dbus_info->interface_object, dbus_info->invocation, NULL);
-                               break;
-                       }
-
-                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-                       if (resp_read->result == SIM_ACCESS_SUCCESS) {
-                               for (i = 0; i < resp_read->data.ecc.ecc_count; i++) {
-                                       dbg("ECC info, Name: [%s], Number: [%s], Category: [0x%x]",
-                                                       resp_read->data.ecc.ecc[i].ecc_string,
-                                                       resp_read->data.ecc.ecc[i].ecc_num,
-                                                       resp_read->data.ecc.ecc[i].ecc_category);
-                                       g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-                                       g_variant_builder_add(&b, "{sv}", "category", g_variant_new_int32(resp_read->data.ecc.ecc[i].ecc_category));
-                                       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}", "name", g_variant_new_string(resp_read->data.ecc.ecc[i].ecc_string));
-                                       g_variant_builder_close(&b);
-                               }
-                               memcpy((void *)&ctx->cached_sim_ecc,
-                                       (const void *)&resp_read->data.ecc,
-                                       sizeof(struct tel_sim_ecc_list));
-                       } else {
-                               ctx->cached_sim_ecc.ecc_count = 0;
-                       }
-                       gv = g_variant_builder_end(&b);
-                       telephony_sim_complete_get_ecc(dbus_info->interface_object, dbus_info->invocation, gv);
-                       g_variant_unref(gv);
-               } break;
+                       memcpy((void*)&ctx->cached_sim_ecc, (const void*)&resp_read->data.ecc, sizeof(struct tel_sim_ecc_list));
+                       break;
 
                case TRESP_SIM_GET_ICCID:
                        dbg("resp comm - TRESP_SIM_GET_ICCID");
@@ -1910,6 +1898,7 @@ gboolean dbus_plugin_sim_notification(struct custom_data *ctx, const char *plugi
        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, plugin_name);
                        telephony_sim_emit_status (sim, n_sim_status->sim_status);
                        break;
 
similarity index 99%
rename from src/sms.c
rename to src/legacy/sms.c
index 0b1388c..0a801d4 100644 (file)
--- a/src/sms.c
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
similarity index 99%
rename from src/ss.c
rename to src/legacy/ss.c
index 441f7ba..a33dc6e 100644 (file)
--- a/src/ss.c
@@ -1,9 +1,8 @@
 /*
  * tel-plugin-dbus_tapi
  *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
+ * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.