4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
25 #include <glib-object.h>
31 #include <communicator.h>
32 #include <core_object.h>
34 #include <user_request.h>
38 #include "generated-code.h"
40 #include "sat_manager.h"
41 #include "sat_ui_support/sat_ui_support.h"
43 static gboolean on_sat_get_main_menu_info(TelephonySAT *sat, GDBusMethodInvocation *invocation,
46 struct custom_data *ctx = user_data;
47 GVariant *main_menu = NULL;
50 gint result = 1, command_id, item_cnt;
51 gboolean b_present, b_help_info, b_updated;
55 if(!ctx->cached_sat_main_menu){
60 main_menu = ctx->cached_sat_main_menu;
62 g_variant_get(main_menu, "(ibs@vibb)", &command_id, &b_present, &title, &items, &item_cnt,
63 &b_help_info, &b_updated);
65 telephony_sat_complete_get_main_menu_info(sat, invocation, result, command_id, b_present, title,
66 items, item_cnt, b_help_info, b_updated);
71 static gboolean on_sat_send_display_status(TelephonySAT *sat, GDBusMethodInvocation *invocation,
72 gint arg_command_id, gboolean arg_display_status,
75 TcorePlugin *plg = NULL;
77 struct custom_data *ctx = user_data;
78 gboolean result = FALSE;
81 plugin_name = GET_PLUGIN_NAME(invocation);
82 plg = tcore_server_find_plugin(ctx->server, plugin_name);
84 dbg("there is no valid plugin at this point");
86 telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
90 result = sat_manager_handle_ui_display_status(ctx, plg, arg_command_id, arg_display_status);
92 dbg("fail to send exec result");
95 out_param = (result ? 1 : 0);
96 telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
100 static gboolean on_sat_send_user_confirm(TelephonySAT *sat, GDBusMethodInvocation *invocation,
101 gint arg_command_id, gint arg_command_type, gint arg_user_confirm_type,
102 GVariant *arg_additional_data, gpointer user_data)
104 TcorePlugin *plg = NULL;
106 struct custom_data *ctx = user_data;
108 gboolean result = FALSE;
110 GVariant *confirm_data = NULL;
112 plugin_name = GET_PLUGIN_NAME(invocation);
113 plg = tcore_server_find_plugin(ctx->server, plugin_name);
115 dbg("there is no valid plugin at this point");
117 telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
121 confirm_data = g_variant_new("(iiv)", arg_command_id, arg_user_confirm_type, arg_additional_data);
123 result = sat_manager_handle_user_confirm(ctx, plg, confirm_data);
125 dbg("fail to send user confirm");
128 out_param = (result ? 1 : 0);
129 telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
134 static gboolean on_sat_send_app_exec_result(TelephonySAT *sat, GDBusMethodInvocation *invocation,
135 gint arg_command_id, gint arg_command_type, GVariant *arg_exec_result,
138 TcorePlugin *plg = NULL;
140 struct custom_data *ctx = user_data;
142 gboolean result = FALSE;
145 plugin_name = GET_PLUGIN_NAME(invocation);
146 plg = tcore_server_find_plugin(ctx->server, plugin_name);
148 dbg("there is no valid plugin at this point");
150 telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
154 dbg("processing app exec result");
155 result = sat_manager_handle_app_exec_result(ctx, plg, arg_command_id, arg_command_type, arg_exec_result);
157 dbg("fail to send exec result");
160 out_param = (result ? 1 : 0);
161 telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
165 static gboolean on_sat_select_menu(TelephonySAT *sat, GDBusMethodInvocation *invocation,
166 guchar arg_item_identifier, gboolean arg_help_request,
169 struct custom_data *ctx = user_data;
170 UserRequest *ur = NULL;
172 struct treq_sat_envelop_cmd_data envelop_data;
174 ur = MAKE_UR(ctx, sat, invocation);
175 memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
176 envelop_data.sub_cmd = ENVELOP_MENU_SELECTION;
177 envelop_data.envelop_data.menu_select.device_identitie.src = DEVICE_ID_KEYPAD;
178 envelop_data.envelop_data.menu_select.device_identitie.dest = DEVICE_ID_SIM;
179 envelop_data.envelop_data.menu_select.item_identifier.item_identifier = arg_item_identifier;
180 envelop_data.envelop_data.menu_select.help_request = arg_help_request;
182 tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), &envelop_data);
183 tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
184 tcore_communicator_dispatch_request(ctx->comm, ur);
189 static gboolean on_sat_download_event(TelephonySAT *sat, GDBusMethodInvocation *invocation,
190 gint arg_event_download_type, gint arg_src_device,gint arg_dest_device,
191 GVariant *arg_download_data, gpointer user_data)
193 struct custom_data *ctx = user_data;
194 UserRequest *ur = NULL;
196 struct treq_sat_envelop_cmd_data envelop_data;
198 ur = MAKE_UR(ctx, sat, invocation);
199 memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
200 envelop_data.sub_cmd = ENVELOP_EVENT_DOWNLOAD;
201 envelop_data.envelop_data.event_download.event = arg_event_download_type;
202 sat_manager_handle_event_download_envelop(arg_event_download_type, arg_src_device, arg_dest_device,
203 &envelop_data.envelop_data.event_download, arg_download_data);
205 tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), &envelop_data);
206 tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
207 tcore_communicator_dispatch_request(ctx->comm, ur);
212 gboolean dbus_plugin_setup_sat_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
216 sat = telephony_sat_skeleton_new();
217 telephony_object_skeleton_set_sat(object, sat);
220 dbg("sat = %p", sat);
222 g_signal_connect (sat,
223 "handle-get-main-menu-info",
224 G_CALLBACK (on_sat_get_main_menu_info),
227 g_signal_connect (sat,
228 "handle-send-ui-display-status",
229 G_CALLBACK (on_sat_send_display_status),
232 g_signal_connect (sat,
233 "handle-send-user-confirm",
234 G_CALLBACK (on_sat_send_user_confirm),
237 g_signal_connect (sat,
238 "handle-send-app-exec-result",
239 G_CALLBACK (on_sat_send_app_exec_result),
242 g_signal_connect (sat,
243 "handle-select-menu",
244 G_CALLBACK (on_sat_select_menu),
247 g_signal_connect (sat,
248 "handle-download-event",
249 G_CALLBACK (on_sat_download_event),
255 gboolean dbus_plugin_sat_response(struct custom_data *ctx, UserRequest *ur,
256 struct dbus_request_info *dbus_info, enum tcore_response_command command,
257 unsigned int data_len, const void *data)
259 const struct tresp_sat_envelop_data *envelop_rsp = NULL;
261 dbg("sat response command = [0x%x], data_len = %d", command, data_len);
264 case TRESP_SAT_REQ_ENVELOPE: {
265 envelop_rsp = (struct tresp_sat_envelop_data *)data;
267 dbg("envelop sub_cmd(%d) result(%d) rsp(%d)", envelop_rsp->sub_cmd, envelop_rsp->result, envelop_rsp->envelop_resp);
269 if(envelop_rsp->sub_cmd == ENVELOP_MENU_SELECTION){
270 telephony_sat_complete_select_menu(dbus_info->interface_object, dbus_info->invocation,
271 envelop_rsp->result, envelop_rsp->envelop_resp);
273 else if(envelop_rsp->sub_cmd == ENVELOP_EVENT_DOWNLOAD){
274 telephony_sat_complete_download_event(dbus_info->interface_object, dbus_info->invocation,
275 envelop_rsp->result, envelop_rsp->envelop_resp);
279 case TRESP_SAT_REQ_TERMINALRESPONSE:
280 dbg("receive TRESP_SAT_REQ_TERMINALRESPONSE");
284 dbg("not handled command[%d]", command);
290 gboolean dbus_plugin_sat_notification(struct custom_data *ctx, const char *plugin_name,
291 TelephonyObjectSkeleton *object, enum tcore_notification_command command,
292 unsigned int data_len, const void *data)
294 TcorePlugin *plg = NULL;
296 struct tnoti_sat_proactive_ind *p_ind = (struct tnoti_sat_proactive_ind *)data;
299 dbg("object is NULL");
303 plg = tcore_server_find_plugin(ctx->server, plugin_name);
305 dbg("there is no valid plugin at this point");
309 sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
310 dbg("sat = %p", sat);
312 dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
314 if (command == TNOTI_SAT_SESSION_END) {
316 dbg("notified sat session end evt");
317 sat_manager_init_queue(ctx);
319 sat_ui_support_terminate_sat_ui();
320 telephony_sat_emit_end_proactive_session(sat, SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
324 //Proactive Command Notification
325 dbg("notified sat proactive command(%d)", p_ind->cmd_type);
327 switch (p_ind->cmd_type) {
328 case SAT_PROATV_CMD_SETUP_MENU:{
330 GVariant *menu_info = NULL;
331 GVariant *resp = NULL;
332 GVariant *exec_result = NULL;
335 gint command_id, menu_cnt;
336 gboolean b_present, b_helpinfo, b_updated;
339 menu_info = sat_manager_caching_setup_menu_info(ctx, plugin_name, (struct tel_sat_setup_menu_tlv*) &p_ind->proactive_ind_data.setup_menu);
340 ctx->cached_sat_main_menu = menu_info;
343 dbg("no main menu data");
344 sat_ui_support_remove_desktop_file();
348 dbg("menu_info type_format(%s)", g_variant_get_type_string(menu_info));
349 g_variant_get(menu_info, "(ibs@vibb)", &command_id, &b_present, &title, &items,
350 &menu_cnt, &b_helpinfo, &b_updated);
352 rv = sat_ui_support_create_desktop_file(title);
354 dbg("return value (%d)", rv);
356 resp = g_variant_new("(i)", RESULT_SUCCESS);
358 resp = g_variant_new("(i)", RESULT_ME_UNABLE_TO_PROCESS_COMMAND);
360 exec_result = g_variant_new_variant(resp);
361 sat_manager_handle_app_exec_result(ctx, plg, command_id, SAT_PROATV_CMD_SETUP_MENU, exec_result);
363 //sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SETUP_MENU, menu_info);
365 telephony_sat_emit_setup_menu(sat, command_id, b_present, title, items, menu_cnt,
366 b_helpinfo, b_updated);
369 case SAT_PROATV_CMD_DISPLAY_TEXT:{
370 GVariant *display_text = NULL;
372 gint command_id, text_len, duration;
373 gboolean high_priority, user_rsp_required, immediately_rsp;
374 gchar text[SAT_TEXT_STRING_LEN_MAX];
375 GVariant *icon_id = NULL;
377 display_text = sat_manager_display_text_noti(ctx, plugin_name, (struct tel_sat_display_text_tlv*) &p_ind->proactive_ind_data.display_text);
380 dbg("no display text data");
384 dbg("display text type_format(%s)", g_variant_get_type_string(display_text));
385 g_variant_get(display_text, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
386 &high_priority, &user_rsp_required, &immediately_rsp, &icon_id);
388 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_DISPLAY_TEXT, display_text);
390 telephony_sat_emit_display_text(sat, command_id, text, text_len, duration,
391 high_priority, user_rsp_required, immediately_rsp);
395 case SAT_PROATV_CMD_SELECT_ITEM:{
396 GVariant *select_menu = NULL;
399 gchar *selected_text;
400 gint command_id, default_item_id, menu_cnt, text_len =0;
401 GVariant *menu_items, *icon_id, *icon_list;
403 select_menu = sat_manager_select_item_noti(ctx, plugin_name, (struct tel_sat_select_item_tlv*) &p_ind->proactive_ind_data.select_item);
406 dbg("no select menu data");
410 dbg("select menu type_format(%s)", g_variant_get_type_string(select_menu));
411 g_variant_get(select_menu, "(ibsiii@v@v@v)", &command_id, &help_info, &selected_text,
412 &text_len, &default_item_id, &menu_cnt, &menu_items, &icon_id, &icon_list);
414 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SELECT_ITEM, select_menu);
416 telephony_sat_emit_select_item (sat, command_id, help_info, selected_text, text_len,
417 default_item_id, menu_cnt, menu_items);
420 case SAT_PROATV_CMD_GET_INKEY:{
421 GVariant *get_inkey = NULL;
423 gint command_id, key_type, input_character_mode;
424 gint text_len, duration;
425 gboolean b_numeric, b_help_info;
429 get_inkey = sat_manager_get_inkey_noti(ctx, plugin_name, (struct tel_sat_get_inkey_tlv*) &p_ind->proactive_ind_data.get_inkey);
432 dbg("no get inkey data");
436 dbg("get inkey type_format(%s)", g_variant_get_type_string(get_inkey));
437 g_variant_get(get_inkey, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
438 &b_numeric,&b_help_info, &text, &text_len, &duration, &icon_id);
440 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INKEY, get_inkey);
442 telephony_sat_emit_get_inkey(sat, command_id, key_type, input_character_mode,
443 b_numeric, b_help_info, text, text_len, duration);
446 case SAT_PROATV_CMD_GET_INPUT:{
447 GVariant *get_input = NULL;
449 gint command_id, input_character_mode;
450 gint text_len, def_text_len, rsp_len_min, rsp_len_max;
451 gboolean b_numeric, b_help_info, b_echo_input;
452 gchar *text, *def_text;
455 get_input = sat_manager_get_input_noti(ctx, plugin_name, (struct tel_sat_get_input_tlv*) &p_ind->proactive_ind_data.get_input);
458 dbg("no get input data");
462 dbg("get input type_format(%s)", g_variant_get_type_string(get_input));
463 g_variant_get(get_input, "(iibbbsiiisi@v)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input,
464 &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len, &icon_id);
466 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INPUT, get_input);
468 telephony_sat_emit_get_input(sat, command_id, input_character_mode, b_numeric, b_help_info,
469 b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len);
472 case SAT_PROATV_CMD_PLAY_TONE:{
473 GVariant *play_tone = NULL;
475 gint command_id, tone_type, duration;
480 play_tone = sat_manager_play_tone_noti(ctx, plugin_name, (struct tel_sat_play_tone_tlv*) &p_ind->proactive_ind_data.play_tone);
483 dbg("no play tone data");
487 dbg("play tone type_format(%s)", g_variant_get_type_string(play_tone));
488 g_variant_get(play_tone, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
490 dbg("check display text : text(%s) text len(%d)", text, text_len);
491 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
492 GVariant *ui_info = NULL;
493 gboolean user_confirm = FALSE;
494 dbg("text should be displayed by ui");
495 dbg("play tone is pending!!!")
497 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
498 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
502 telephony_sat_emit_play_tone(sat, command_id, text, text_len, tone_type, duration);
505 case SAT_PROATV_CMD_SEND_SMS:{
506 GVariant *send_sms = NULL;
508 gint command_id, ton, npi, tpdu_type;
509 gboolean b_packing_required;
510 gint text_len, number_len, tpdu_data_len;
511 gchar* text, *dialling_number;
512 GVariant *tpdu_data, *icon_id;
514 send_sms = sat_manager_send_sms_noti(ctx, plugin_name, (struct tel_sat_send_sms_tlv*) &p_ind->proactive_ind_data.send_sms);
517 dbg("no send sms data");
521 dbg("send sms type_format(%s)", g_variant_get_type_string(send_sms));
522 g_variant_get(send_sms, "(isi@vbiisii@vi)", &command_id, &text, &text_len, &icon_id, &b_packing_required, &ton, &npi,
523 &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
525 dbg("check display text : text(%s) text len(%d)", text, text_len);
526 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
527 GVariant *ui_info = NULL;
528 gboolean user_confirm = FALSE;
529 dbg("text should be displayed by ui");
530 dbg("send sms is pending!!!")
532 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
533 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
537 telephony_sat_emit_send_sms(sat, command_id, text, text_len, b_packing_required,
538 ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
541 case SAT_PROATV_CMD_SEND_SS:{
542 GVariant *send_ss = NULL;
544 gint command_id, ton, npi;
545 gint text_len, ss_str_len;
546 gchar* text, *ss_string;
550 send_ss = sat_manager_send_ss_noti(ctx, plugin_name, (struct tel_sat_send_ss_tlv*) &p_ind->proactive_ind_data.send_ss);
553 dbg("no send ss data");
557 dbg("send ss type_format(%s)", g_variant_get_type_string(send_ss));
558 g_variant_get(send_ss, "(isi@viiis)", &command_id, &text, &text_len, &icon_id,
559 &ton, &npi, &ss_str_len, &ss_string);
561 dbg("check display text : text(%s) text len(%d)", text, text_len);
562 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
563 GVariant *ui_info = NULL;
564 gboolean user_confirm = FALSE;
565 dbg("text should be displayed by ui");
566 dbg("send ss is pending!!!")
568 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
569 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
573 telephony_sat_emit_send_ss(sat, command_id, text, text_len, ton, npi, ss_string);
576 case SAT_PROATV_CMD_SEND_USSD:{
577 GVariant *send_ussd = NULL;
580 gint text_len, ussd_str_len;
581 gchar* text, *ussd_string;
585 send_ussd = sat_manager_send_ussd_noti(ctx, plugin_name, (struct tel_sat_send_ussd_tlv*) &p_ind->proactive_ind_data.send_ussd);
588 dbg("no send ussd data");
592 dbg("send ussd type_format(%s)", g_variant_get_type_string(send_ussd));
593 g_variant_get(send_ussd, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &ussd_str_len, &ussd_string);
595 dbg("check display text : text(%s) text len(%d)", text, text_len);
596 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
597 GVariant *ui_info = NULL;
598 gboolean user_confirm = FALSE;
599 dbg("text should be displayed by ui");
600 dbg("send ussd is pending!!!")
602 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
603 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
607 telephony_sat_emit_setup_ussd(sat, command_id, text, text_len, ussd_string);
610 case SAT_PROATV_CMD_SETUP_CALL:{
611 GVariant *setup_call = NULL;
613 gint command_id, call_type, text_len, duration;
614 gchar *text, *call_number;
617 setup_call = sat_manager_setup_call_noti(ctx, plugin_name, (struct tel_sat_setup_call_tlv*) &p_ind->proactive_ind_data.setup_call);
620 dbg("no setup call data");
624 dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
625 g_variant_get(setup_call, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
627 dbg("check display text : text(%s) text len(%d)", text, text_len);
628 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
629 GVariant *ui_info = NULL;
630 gboolean user_confirm = TRUE;
631 dbg("text should be displayed by ui");
632 dbg("setup call is pending!!!")
634 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
635 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
639 telephony_sat_emit_setup_call(sat, command_id, text, text_len, call_type,
640 call_number, duration);
643 case SAT_PROATV_CMD_SETUP_EVENT_LIST:{
644 GVariant *event_list = NULL;
649 event_list = sat_manager_setup_event_list_noti(ctx, plugin_name, (struct tel_sat_setup_event_list_tlv*) &p_ind->proactive_ind_data.setup_event_list);
652 dbg("no setup event list data");
656 dbg("setup event list type_format(%s)", g_variant_get_type_string(event_list));
657 g_variant_get(event_list, "(i@v)", &event_cnt, &evt_list);
659 telephony_sat_emit_setup_event_list(sat, event_cnt, evt_list);
662 case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:{
663 GVariant *setup_idle_mode = NULL;
665 gint command_id, text_len;
669 setup_idle_mode = sat_manager_setup_idle_mode_text_noti(ctx, plugin_name, (struct tel_sat_setup_idle_mode_text_tlv*) &p_ind->proactive_ind_data.setup_idle_mode_text);
671 if(!setup_idle_mode){
672 dbg("no setup idle mode text data");
676 dbg("setup idle mode text type_format(%s)", g_variant_get_type_string(setup_idle_mode));
677 g_variant_get(setup_idle_mode, "(isi@v)", &command_id, &text, &text_len, &icon_id);
679 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
680 GVariant *ui_info = NULL;
681 gboolean user_confirm = TRUE;
682 dbg("text should be displayed by ui");
683 dbg("setup idle mode text is displayed!!!")
685 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
686 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
690 telephony_sat_emit_setup_idle_mode_text(sat, command_id, text, text_len);
693 case SAT_PROATV_CMD_OPEN_CHANNEL:{
694 GVariant *open_channel = NULL;
696 gint command_id, bearer_type, protocol_type, dest_addr_type;
697 gboolean immediate_link, auto_reconnection, bg_mode;
698 gint text_len, buffer_size, port_number;
699 gchar *text, *dest_address;
701 GVariant *bearer_param;
702 GVariant *bearer_detail;
704 open_channel = sat_manager_open_channel_noti(ctx, plugin_name, (struct tel_sat_open_channel_tlv*) &p_ind->proactive_ind_data.open_channel);
707 dbg("no open channel data");
711 dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
712 g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
713 &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
715 dbg("check display text : text(%s) text len(%d)", text, text_len);
716 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
717 GVariant *ui_info = NULL;
718 gboolean user_confirm = TRUE;
719 dbg("text should be displayed by ui");
720 dbg("open channel text is displayed!!!")
722 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
723 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
727 telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
728 bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
731 case SAT_PROATV_CMD_CLOSE_CHANNEL:{
732 GVariant *close_channel = NULL;
734 gint command_id, channel_id, text_len;
738 close_channel = sat_manager_close_channel_noti(ctx, plugin_name, (struct tel_sat_close_channel_tlv*) &p_ind->proactive_ind_data.close_channel);
741 dbg("no close channel data");
745 //TODO check the data for sat-ui
747 dbg("close channel type_format(%s)", g_variant_get_type_string(close_channel));
748 g_variant_get(close_channel, "(isi@vi)", &command_id, &text, &text_len, &icon_id, &channel_id);
750 telephony_sat_emit_close_channel(sat, command_id, text, text_len, channel_id);
753 case SAT_PROATV_CMD_RECEIVE_DATA:{
754 GVariant *receive_data = NULL;
756 gint command_id, text_len, channel_id, channel_data_len = 0;
760 receive_data = sat_manager_receive_data_noti(ctx, plugin_name, (struct tel_sat_receive_channel_tlv*) &p_ind->proactive_ind_data.receive_data);
763 dbg("no receive data data");
767 //TODO check the data for sat-ui
769 dbg("receive data type_format(%s)", g_variant_get_type_string(receive_data));
770 g_variant_get(receive_data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &channel_id, &channel_data_len);
772 telephony_sat_emit_receive_data(sat, command_id, text, text_len, channel_id, channel_data_len);
775 case SAT_PROATV_CMD_SEND_DATA:{
776 GVariant *send_data = NULL;
778 gint command_id, channel_id, text_len, channel_data_len;
779 gboolean send_data_immediately;
781 GVariant *channel_data;
784 send_data = sat_manager_send_data_noti(ctx, plugin_name, (struct tel_sat_send_channel_tlv*) &p_ind->proactive_ind_data.send_data);
787 dbg("no send data data");
791 //TODO check the data for sat-ui
793 dbg("send data type_format(%s)", g_variant_get_type_string(send_data));
794 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);
796 telephony_sat_emit_send_data(sat, command_id, text, text_len, channel_id, send_data_immediately, channel_data, channel_data_len);
799 case SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
800 GVariant *channel_status = NULL;
804 channel_status = sat_manager_get_channel_status_noti(ctx, plugin_name, (struct tel_sat_get_channel_status_tlv*) &p_ind->proactive_ind_data.get_channel_status);
807 dbg("no get channel status data");
811 //TODO check the data for sat-ui
813 dbg("get channel status type_format(%s)", g_variant_get_type_string(channel_status));
814 g_variant_get(channel_status, "(i)", &command_id);
816 telephony_sat_emit_get_channel_status(sat, command_id);
819 case SAT_PROATV_CMD_REFRESH:{
820 GVariant *refresh = NULL;
822 gint refresh_type =0;
823 GVariant *file_list = NULL;
825 GVariant *ui_info = NULL;
826 gboolean user_confirm = FALSE;
827 gchar info[] = "refresh from SIM TOOLKIT";
829 refresh = sat_manager_refresh_noti(ctx, plugin_name, (struct tel_sat_refresh_tlv*) &p_ind->proactive_ind_data.refresh);
832 dbg("no refresh data");
836 dbg("refresh type_format(%s)", g_variant_get_type_string(refresh));
837 g_variant_get(refresh, "(ii@v)", &command_id, &refresh_type, &file_list);
839 dbg("check refresh_type(%d)", refresh_type);
840 dbg("text should be displayed by ui");
842 ui_info = g_variant_new("(isib)", command_id, info, strlen(info), user_confirm);
843 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
845 telephony_sat_emit_refresh(sat, command_id, refresh_type, file_list);
848 case SAT_PROATV_CMD_MORE_TIME:{
849 sat_manager_more_time_noti(ctx, plugin_name, (struct tel_sat_more_time_tlv*) &p_ind->proactive_ind_data.more_time);
850 telephony_sat_emit_more_time(sat);
853 case SAT_PROATV_CMD_SEND_DTMF:{
854 GVariant *send_dtmf = NULL;
856 gint text_len = 0, dtmf_str_len = 0;
858 gchar *dtmf_str = NULL;
859 GVariant *icon_id = NULL;
861 send_dtmf = sat_manager_send_dtmf_noti(ctx, plugin_name, (struct tel_sat_send_dtmf_tlv*) &p_ind->proactive_ind_data.send_dtmf);
863 dbg("no send_dtmf data");
867 dbg("send_dtmf type_format(%s)", g_variant_get_type_string(send_dtmf));
868 g_variant_get(send_dtmf, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &dtmf_str, &dtmf_str_len);
870 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
871 GVariant *ui_info = NULL;
872 gboolean user_confirm = FALSE;
873 dbg("text should be displayed by ui");
874 dbg("send dtmf is displayed!!!")
876 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
877 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
881 telephony_sat_emit_send_dtmf(sat, command_id, text, text_len, dtmf_str, dtmf_str_len);
884 case SAT_PROATV_CMD_LAUNCH_BROWSER:{
885 GVariant *launch_browser = NULL;
888 gint url_len = 0, text_len = 0, gateway_proxy_len =0;
891 gchar *gateway_proxy = NULL;
892 GVariant *icon_id = NULL;
894 launch_browser = sat_manager_launch_browser_noti(ctx, plugin_name, (struct tel_sat_launch_browser_tlv*) &p_ind->proactive_ind_data.launch_browser);
896 dbg("no launch_browser data");
900 dbg("launch_browser type_format(%s)", g_variant_get_type_string(launch_browser));
901 g_variant_get(launch_browser, "(iisisisi@v)", &command_id, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
903 if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
904 GVariant *ui_info = NULL;
905 gboolean user_confirm = TRUE;
906 dbg("text should be displayed by ui");
907 dbg("launch browser is displayed!!!")
909 ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
910 sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
914 telephony_sat_emit_launch_browser(sat, command_id, browser_id, url, url_len, gateway_proxy, gateway_proxy_len, text, text_len);
917 case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:{
918 GVariant *provide_info = NULL;
922 provide_info = sat_manager_provide_local_info_noti(ctx, plugin_name, (struct tel_sat_provide_local_info_tlv*) &p_ind->proactive_ind_data.provide_local_info);
924 dbg("no provide_info data");
928 dbg("provide_info type_format(%s)", g_variant_get_type_string(provide_info));
929 g_variant_get(provide_info, "(ii)", &command_id, &info_type);
931 telephony_sat_emit_provide_local_info(sat, command_id, info_type);
934 case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:{
935 GVariant *language_noti = NULL;
938 gboolean b_specified = FALSE;
940 language_noti = sat_manager_language_notification_noti(ctx, plugin_name, (struct tel_sat_language_notification_tlv*) &p_ind->proactive_ind_data.language_notification);
942 dbg("no language_noti data");
946 dbg("language_noti type_format(%s)", g_variant_get_type_string(language_noti));
947 g_variant_get(language_noti, "(iib)", &command_id, &language, &b_specified);
949 telephony_sat_emit_language_notification(sat, command_id, language, b_specified);
953 dbg("not handled ind->cmd_type[0x%x]", p_ind->cmd_type);