rec_status_sub_info = atoi(sub_info);
free(sub_info);
- switch(rec_status_sub_info) {
+ switch (rec_status_sub_info) {
case CALLMGR_POPUP_REC_STATUS_STOP_BY_NORMAL_E:
_callmgr_popup_create_toast_msg(_("IDS_CALL_TPOP_RECORDING_SAVED_IN_VOICE_RECORDER"));
break;
return;
}
result = app_control_create(&reply);
- if(result != APP_CONTROL_ERROR_NONE) {
+ if (result != APP_CONTROL_ERROR_NONE) {
WARN("app_control_create() return error : %d", result);
return;
}
#include <Eina.h>
#include <efl_extension.h>
#include <efl_util.h>
-/* ToDo: Need check replace */
+/* ToDo: Need check replace */
//#include <Ecore_X.h>
//#include <Ecore_X_Atoms.h>
//#include <utilX.h>
#include "callmgr-popup-util.h"
#include "callmgr-popup-vconf.h"
-/* ToDo: Need check replace */
+/* ToDo: Need check replace */
#define KEY_POWER "XF86PowerOff"
#define KEY_HOME "XF86Home"
#define SHARED_GRAB 0x000f00
efl_util_set_notification_window_level(parent, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
/* Set Notification window */
- /* ToDo: Need check replace */
+ /* ToDo: Need check replace */
/* ecore_x_netwm_window_type_set(xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION); */
- /* ToDo: Need check replace */
+ /* ToDo: Need check replace */
/* utilx_set_system_notification_level(ecore_x_display_get(), xwin, UTILX_NOTIFICATION_LEVEL_HIGH); */
//ecore_x_window_prop_card32_set(xwin, qp_scroll_state, val, 3);
}
_callmgr_popup_del_popup(ad);
ad->popup = elm_popup_add(ad->win_main);
- elm_object_style_set(ad->popup,"theme_bg");
+ elm_object_style_set(ad->popup, "theme_bg");
elm_popup_align_set(ad->popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
evas_object_size_hint_weight_set(ad->popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
kb = bundle_create();
appsvc_set_operation(kb, APPSVC_OPERATION_CALL);
- appsvc_set_uri(kb,"tel:MT");
+ appsvc_set_uri(kb, "tel:MT");
g_snprintf(buf, 2, "%d", cb_data->call_id);
dbg("call_id : [%s]", buf);
msg_struct = msg_create_struct(MSG_STRUCT_SETTING_VOICE_MSG_OPT);
err = msg_set_int_value(msg_struct, MSG_VOICEMSG_SIM_INDEX_INT, sim_slot + 1);
- if(MSG_SUCCESS != err) {
+ if (MSG_SUCCESS != err) {
err("msg_set_int_value error[%d]..", err);
msg_release_struct(&msg_struct);
msg_close_msg_handle(&msgHandle);
int ret = PLAYER_ERROR_NONE;
int ret_val = 0;
- if (answer_msg_handle->player_handle!= NULL) {
+ if (answer_msg_handle->player_handle != NULL) {
/* Destroy the player */
ret = player_destroy(answer_msg_handle->player_handle);
if (ret != PLAYER_ERROR_NONE) {
CM_RETURN_VAL_IF_FAIL(answer_msg_handle, -1);
int ret = PLAYER_ERROR_NONE;
- if (answer_msg_handle->player_handle!= NULL) {
+ if (answer_msg_handle->player_handle != NULL) {
__callmgr_answer_msg_destory_player(answer_msg_handle);
}
int ret = PLAYER_ERROR_NONE;
int ret_val = 0;
- if (answer_msg_handle->player_handle== NULL) {
+ if (answer_msg_handle->player_handle == NULL) {
err("player_handle = NULL, returning");
return -1;
}
answer_msg_handle->finished_cb = finished_cb;
answer_msg_handle->user_data = user_data;
- if(__callmgr_answer_msg_start_play(answer_msg_handle, answer_msg_path, __callmgr_answer_msg_play_ment_finish_cb) < 0) {
+ if (__callmgr_answer_msg_start_play(answer_msg_handle, answer_msg_path, __callmgr_answer_msg_play_ment_finish_cb) < 0) {
err("__callmgr_answer_msg_start_play() ERR");
ret_val = -1;
}
}
switch (mode) {
- case CALLMGR_AUDIO_SESSION_VOICE_E:
- stream_type = SOUND_STREAM_TYPE_VOICE_CALL;
- break;
- case CALLMGR_AUDIO_SESSION_VIDEO_E:
- stream_type = SOUND_STREAM_TYPE_VIDEO_CALL;
- break;
- case CALLMGR_AUDIO_SESSION_NONE_E:
- default:
- err("unhandled session mode: %d", mode);
- return -1;
+ case CALLMGR_AUDIO_SESSION_VOICE_E:
+ stream_type = SOUND_STREAM_TYPE_VOICE_CALL;
+ break;
+ case CALLMGR_AUDIO_SESSION_VIDEO_E:
+ stream_type = SOUND_STREAM_TYPE_VIDEO_CALL;
+ break;
+ case CALLMGR_AUDIO_SESSION_NONE_E:
+ default:
+ err("unhandled session mode: %d", mode);
+ return -1;
}
ret = sound_manager_create_stream_information_internal(stream_type, __callmgr_audio_call_stream_focus_state_cb, NULL, &audio_handle->sound_stream_handle);
return -1;
}
- return 0;
+ return 0;
}
int _callmgr_audio_stop_virtual_stream(callmgr_audio_handle_h audio_handle)
sound_device_type_e o_device_type;
int ret = -1;
- ret = sound_manager_get_current_device_list (SOUND_DEVICE_ALL_MASK, &device_list);
+ ret = sound_manager_get_current_device_list(SOUND_DEVICE_ALL_MASK, &device_list);
if (ret != SOUND_MANAGER_ERROR_NONE) {
err("sound_manager_get_current_device_list() get failed");
return -1;
}
while (1) {
- ret = sound_manager_get_next_device (device_list, &device);
+ ret = sound_manager_get_next_device(device_list, &device);
if (ret == SOUND_MANAGER_ERROR_NONE && device) {
sound_manager_get_device_type(device, &o_device_type);
if (o_device_type == device_type) {
info("found device!!");
break;
}
- }
- else {
+ } else {
err("sound_manager_get_next_device() failed with err[%d]", ret);
return -1;
}
CM_RETURN_VAL_IF_FAIL(audio_handle, -1);
#if 0
int is_noise_reduction = 0;
-
+
/* ToDo : vconf will be changed to MM API */
switch (route) {
case SOUND_SESSION_CALL_MODE_VOICE_WITH_BLUETOOTH:
dbg("_callmgr_audio_set_audio_route");
- switch(route) {
- case CALLMGR_AUDIO_ROUTE_SPEAKER_E:
- device_type = SOUND_DEVICE_BUILTIN_SPEAKER;
- break;
- case CALLMGR_AUDIO_ROUTE_RECEIVER_E:
- device_type = SOUND_DEVICE_BUILTIN_RECEIVER;
- break;
- case CALLMGR_AUDIO_ROUTE_EARJACK_E:
- device_type = SOUND_DEVICE_AUDIO_JACK;
- break;
- case CALLMGR_AUDIO_ROUTE_BT_E:
- device_type = SOUND_DEVICE_BLUETOOTH;
- break;
- default:
- err("unhandled route[%d]", route);
- return -1;
+ switch (route) {
+ case CALLMGR_AUDIO_ROUTE_SPEAKER_E:
+ device_type = SOUND_DEVICE_BUILTIN_SPEAKER;
+ break;
+ case CALLMGR_AUDIO_ROUTE_RECEIVER_E:
+ device_type = SOUND_DEVICE_BUILTIN_RECEIVER;
+ break;
+ case CALLMGR_AUDIO_ROUTE_EARJACK_E:
+ device_type = SOUND_DEVICE_AUDIO_JACK;
+ break;
+ case CALLMGR_AUDIO_ROUTE_BT_E:
+ device_type = SOUND_DEVICE_BLUETOOTH;
+ break;
+ default:
+ err("unhandled route[%d]", route);
+ return -1;
}
if (audio_handle->vstream && !audio_handle->vstream_status) {
|| (audio_handle->current_route == SOUND_DEVICE_BUILTIN_RECEIVER)) {
dbg("Remove Built-in mic device");
__callmgr_audio_get_sound_device(SOUND_DEVICE_BUILTIN_MIC, &sound_device);
- ret = sound_manager_remove_device_for_stream_routing (audio_handle->sound_stream_handle, sound_device);
+ ret = sound_manager_remove_device_for_stream_routing(audio_handle->sound_stream_handle, sound_device);
if (ret != SOUND_MANAGER_ERROR_NONE)
err("sound_manager_remove_device_for_stream_routing() failed:[%d]", ret);
}
dbg("Remove current device [%s]", __callmgr_audio_convert_device_type_to_string(audio_handle->current_route));
__callmgr_audio_get_sound_device(audio_handle->current_route, &sound_device);
- ret = sound_manager_remove_device_for_stream_routing (audio_handle->sound_stream_handle, sound_device);
+ ret = sound_manager_remove_device_for_stream_routing(audio_handle->sound_stream_handle, sound_device);
if (ret != SOUND_MANAGER_ERROR_NONE) {
err("sound_manager_remove_device_for_stream_routing() failed:[%d]", ret);
}
dbg("Add new device [%s]", __callmgr_audio_convert_device_type_to_string(device_type));
__callmgr_audio_get_sound_device(device_type, &sound_device);
__callmgr_audio_set_audio_control_state(audio_handle, sound_device);
- ret = sound_manager_add_device_for_stream_routing (audio_handle->sound_stream_handle, sound_device);
+ ret = sound_manager_add_device_for_stream_routing(audio_handle->sound_stream_handle, sound_device);
if (ret != SOUND_MANAGER_ERROR_NONE) {
err("sound_manager_add_device_for_stream_routing() failed:[%d]", ret);
return -1;
if ((route == CALLMGR_AUDIO_ROUTE_SPEAKER_E) || (route == CALLMGR_AUDIO_ROUTE_RECEIVER_E)) {
dbg("Add Built-in mic device");
__callmgr_audio_get_sound_device(SOUND_DEVICE_BUILTIN_MIC, &sound_device);
- ret = sound_manager_add_device_for_stream_routing (audio_handle->sound_stream_handle, sound_device);
+ ret = sound_manager_add_device_for_stream_routing(audio_handle->sound_stream_handle, sound_device);
if (ret != SOUND_MANAGER_ERROR_NONE) {
err("sound_manager_add_device_for_stream_routing() failed:[%d]", ret);
return -1;
}
}
- ret = sound_manager_apply_stream_routing (audio_handle->sound_stream_handle);
+ ret = sound_manager_apply_stream_routing(audio_handle->sound_stream_handle);
if (ret != SOUND_MANAGER_ERROR_NONE) {
err("sound_manager_apply_stream_routing() failed:[%d]", ret);
return -1;
return -1;
}
- ret = sound_manager_create_virtual_stream (audio_handle->sound_stream_handle, &audio_handle->vstream);
+ ret = sound_manager_create_virtual_stream(audio_handle->sound_stream_handle, &audio_handle->vstream);
if (ret != SOUND_MANAGER_ERROR_NONE) {
err("sound_manager_create_virtual_stream() failed:[%d]", ret);
return -1;
}
- ret = sound_manager_start_virtual_stream (audio_handle->vstream);
+ ret = sound_manager_start_virtual_stream(audio_handle->vstream);
if (ret != SOUND_MANAGER_ERROR_NONE) {
err("sound_manager_start_virtual_stream() failed:[%d]", ret);
return -1;
if (audio_handle->current_route != -1) {
switch (audio_handle->current_route) {
- case SOUND_DEVICE_BUILTIN_SPEAKER:
- route = CALLMGR_AUDIO_ROUTE_SPEAKER_E;
- break;
- case SOUND_DEVICE_BUILTIN_RECEIVER:
- route = CALLMGR_AUDIO_ROUTE_RECEIVER_E;
- break;
- case SOUND_DEVICE_AUDIO_JACK:
- route = CALLMGR_AUDIO_ROUTE_EARJACK_E;
- break;
- case SOUND_DEVICE_BLUETOOTH:
- route = CALLMGR_AUDIO_ROUTE_BT_E;
- break;
- default:
- err("unhandled device type[%d]", audio_handle->current_route);
- break;
+ case SOUND_DEVICE_BUILTIN_SPEAKER:
+ route = CALLMGR_AUDIO_ROUTE_SPEAKER_E;
+ break;
+ case SOUND_DEVICE_BUILTIN_RECEIVER:
+ route = CALLMGR_AUDIO_ROUTE_RECEIVER_E;
+ break;
+ case SOUND_DEVICE_AUDIO_JACK:
+ route = CALLMGR_AUDIO_ROUTE_EARJACK_E;
+ break;
+ case SOUND_DEVICE_BLUETOOTH:
+ route = CALLMGR_AUDIO_ROUTE_BT_E;
+ break;
+ default:
+ err("unhandled device type[%d]", audio_handle->current_route);
+ break;
}
}
*o_route = route;
info("event : %d , id : %d", event, call_id);
switch (event) {
- case BT_AG_CALL_HANDLING_EVENT_ANSWER:
- bt_event = CM_BT_EVENT_CALL_HANDLE_ACCEPT_E;
- break;
- case BT_AG_CALL_HANDLING_EVENT_RELEASE:
- bt_event = CM_BT_EVENT_CALL_HANDLE_RELEASE_E;
- break;
- case BT_AG_CALL_HANDLING_EVENT_REJECT:
- bt_event = CM_BT_EVENT_CALL_HANDLE_REJECT_E;
- break;
- default:
- warn("Invalid event");
- return;
+ case BT_AG_CALL_HANDLING_EVENT_ANSWER:
+ bt_event = CM_BT_EVENT_CALL_HANDLE_ACCEPT_E;
break;
+ case BT_AG_CALL_HANDLING_EVENT_RELEASE:
+ bt_event = CM_BT_EVENT_CALL_HANDLE_RELEASE_E;
+ break;
+ case BT_AG_CALL_HANDLING_EVENT_REJECT:
+ bt_event = CM_BT_EVENT_CALL_HANDLE_REJECT_E;
+ break;
+ default:
+ warn("Invalid event");
+ return;
}
bt_handle->cb_fn(bt_event, GUINT_TO_POINTER(call_id), bt_handle->user_data);
info("event : %d", event);
switch (event) {
- case BT_AG_MULTI_CALL_HANDLING_EVENT_RELEASE_HELD_CALLS:
- bt_event = CM_BT_EVENT_CALL_HANDLE_0_SEND_E;
- break;
- case BT_AG_MULTI_CALL_HANDLING_EVENT_RELEASE_ACTIVE_CALLS:
- bt_event = CM_BT_EVENT_CALL_HANDLE_1_SEND_E;
- break;
- case BT_AG_MULTI_CALL_HANDLING_EVENT_ACTIVATE_HELD_CALL:
- bt_event = CM_BT_EVENT_CALL_HANDLE_2_SEND_E;
- break;
- case BT_AG_MULTI_CALL_HANDLING_EVENT_MERGE_CALLS:
- bt_event = CM_BT_EVENT_CALL_HANDLE_3_SEND_E;
- break;
- case BT_AG_MULTI_CALL_HANDLING_EVENT_EXPLICIT_CALL_TRANSFER:
- bt_event = CM_BT_EVENT_CALL_HANDLE_4_SEND_E;
- break;
- default:
- warn("Invalid event");
- return;
+ case BT_AG_MULTI_CALL_HANDLING_EVENT_RELEASE_HELD_CALLS:
+ bt_event = CM_BT_EVENT_CALL_HANDLE_0_SEND_E;
+ break;
+ case BT_AG_MULTI_CALL_HANDLING_EVENT_RELEASE_ACTIVE_CALLS:
+ bt_event = CM_BT_EVENT_CALL_HANDLE_1_SEND_E;
+ break;
+ case BT_AG_MULTI_CALL_HANDLING_EVENT_ACTIVATE_HELD_CALL:
+ bt_event = CM_BT_EVENT_CALL_HANDLE_2_SEND_E;
break;
+ case BT_AG_MULTI_CALL_HANDLING_EVENT_MERGE_CALLS:
+ bt_event = CM_BT_EVENT_CALL_HANDLE_3_SEND_E;
+ break;
+ case BT_AG_MULTI_CALL_HANDLING_EVENT_EXPLICIT_CALL_TRANSFER:
+ bt_event = CM_BT_EVENT_CALL_HANDLE_4_SEND_E;
+ break;
+ default:
+ warn("Invalid event");
+ return;
}
bt_handle->cb_fn(bt_event, NULL, bt_handle->user_data);
CM_RETURN_VAL_IF_FAIL(bt_handle, -1);
switch (call_event) {
- case CM_BT_AG_RES_CALL_IDLE_E:
- call_event_type = BT_AG_CALL_EVENT_IDLE;
- break;
- case CM_BT_AG_RES_CALL_ACTIVE_E:
- call_event_type = BT_AG_CALL_EVENT_ANSWERED;
- break;
- case CM_BT_AG_RES_CALL_HELD_E:
- call_event_type = BT_AG_CALL_EVENT_HELD;
- break;
- case CM_BT_AG_RES_CALL_DIALING_E:
- call_event_type = BT_AG_CALL_EVENT_DIALING;
- break;
- case CM_BT_AG_RES_CALL_ALERT_E:
- call_event_type = BT_AG_CALL_EVENT_ALERTING;
- break;
- case CM_BT_AG_RES_CALL_INCOM_E:
- call_event_type = BT_AG_CALL_EVENT_INCOMING;
- break;
- default:
- warn("Invalid type : %d", call_event);
- return -1;
- break;
+ case CM_BT_AG_RES_CALL_IDLE_E:
+ call_event_type = BT_AG_CALL_EVENT_IDLE;
+ break;
+ case CM_BT_AG_RES_CALL_ACTIVE_E:
+ call_event_type = BT_AG_CALL_EVENT_ANSWERED;
+ break;
+ case CM_BT_AG_RES_CALL_HELD_E:
+ call_event_type = BT_AG_CALL_EVENT_HELD;
+ break;
+ case CM_BT_AG_RES_CALL_DIALING_E:
+ call_event_type = BT_AG_CALL_EVENT_DIALING;
+ break;
+ case CM_BT_AG_RES_CALL_ALERT_E:
+ call_event_type = BT_AG_CALL_EVENT_ALERTING;
+ break;
+ case CM_BT_AG_RES_CALL_INCOM_E:
+ call_event_type = BT_AG_CALL_EVENT_INCOMING;
+ break;
+ default:
+ warn("Invalid type : %d", call_event);
+ return -1;
}
info("event : %d, id : %d", call_event_type, call_id);
if (CONTACTS_ERROR_NONE == err) {
contacts_list_first(list);
- while(CONTACTS_ERROR_NONE == contacts_list_get_current_record_p(list, &record)) {
+ while (CONTACTS_ERROR_NONE == contacts_list_get_current_record_p(list, &record)) {
contacts_record_get_int(record, _contacts_person_grouprel.group_id, &group_id);
*group_list = g_slist_append(*group_list, GINT_TO_POINTER(group_id));
err = contacts_list_next(list);
/* Get group ringtone path */
err = contacts_record_get_str(group_record, _contacts_group.ringtone_path, &ringtone_path);
if (CONTACTS_ERROR_NONE != err) {
- err( "contacts_record_get_str(group id path) error %d", err);
+ err("contacts_record_get_str(group id path) error %d", err);
} else {
contact_info->caller_ringtone_path = g_strdup(ringtone_path);
if ((remain_max > 0) && (strlen(disp_str) > 0)) {
if (strlen(disp_str) < remain_max) {
strncat(disp_name_str, disp_str, strlen(disp_str));
- }
- else {
+ } else {
strncat(disp_name_str, disp_str, remain_max);
}
}
err("Fail to notification_set_image : %d", noti_err);
}
- if (disp_img_path == NULL){
+ if (disp_img_path == NULL) {
disp_img_path = g_strdup(NOTIFY_MISSED_CALL_ICON);
noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, disp_img_path);
static void __callmgr_ringer_get_adjusted_volume_ratio(int volume_level, float *adjusted_ratio)
{
switch (volume_level) {
- case 1:
- *adjusted_ratio = 0.562;
- break;
- case 2:
- *adjusted_ratio = 0.398;
- break;
- case 3:
- *adjusted_ratio = 0.316;
- break;
- case 4:
- *adjusted_ratio = 0.251;
- break;
- case 5:
- *adjusted_ratio = 0.200;
- break;
- case 6:
- *adjusted_ratio = 0.158;
- break;
- case 7:
- *adjusted_ratio = 0.126;
- break;
- case 8:
- *adjusted_ratio = 0.100;
- break;
- case 9:
- *adjusted_ratio = 0.079;
- break;
- case 10:
- *adjusted_ratio = 0.063;
- break;
- case 11:
- *adjusted_ratio = 0.050;
- break;
- case 12:
- *adjusted_ratio = 0.040;
- break;
- case 13:
- *adjusted_ratio = 0.032;
- break;
- case 14:
- *adjusted_ratio = 0.025;
- break;
- case 15:
- *adjusted_ratio = 0.020;
- break;
- default:
- *adjusted_ratio = 1;
- break;
+ case 1:
+ *adjusted_ratio = 0.562;
+ break;
+ case 2:
+ *adjusted_ratio = 0.398;
+ break;
+ case 3:
+ *adjusted_ratio = 0.316;
+ break;
+ case 4:
+ *adjusted_ratio = 0.251;
+ break;
+ case 5:
+ *adjusted_ratio = 0.200;
+ break;
+ case 6:
+ *adjusted_ratio = 0.158;
+ break;
+ case 7:
+ *adjusted_ratio = 0.126;
+ break;
+ case 8:
+ *adjusted_ratio = 0.100;
+ break;
+ case 9:
+ *adjusted_ratio = 0.079;
+ break;
+ case 10:
+ *adjusted_ratio = 0.063;
+ break;
+ case 11:
+ *adjusted_ratio = 0.050;
+ break;
+ case 12:
+ *adjusted_ratio = 0.040;
+ break;
+ case 13:
+ *adjusted_ratio = 0.032;
+ break;
+ case 14:
+ *adjusted_ratio = 0.025;
+ break;
+ case 15:
+ *adjusted_ratio = 0.020;
+ break;
+ default:
+ *adjusted_ratio = 1;
+ break;
}
if (*adjusted_ratio > 1.0) {
*adjusted_ratio = 1.0;
info("highlight ringtone: startposition(%d)", startposition);
g_free(position);
- }
- else {
+ } else {
warn("position is NULL");
}
- }
- else {
+ } else {
// ToDo: in case of contact ringtone and group ringtone
}
err("player_stop() failed: [0x%x]", ret);
return -1;
- }
- else {
+ } else {
info("player_stop done");
}
}
err("player_unprepare() failed: [0x%x]", ret);
return -1;
- }
- else {
+ } else {
info("player_unprepare done");
}
if (PLAYER_ERROR_NONE != ret) {
err("player_destroy() failed: [0x%x]", ret);
return -1;
- }
- else {
+ } else {
info("player_destroy done");
}
}
ringer_handle->alternate_tone_play_count++;
- if(CALLMGR_2ND_CALL_BEEP_COUNT == ringer_handle->alternate_tone_play_count) {
+ if (CALLMGR_2ND_CALL_BEEP_COUNT == ringer_handle->alternate_tone_play_count) {
ringer_handle->alternate_tone_play_count = 0;
_callmgr_ringer_stop_alternate_tone(ringer_handle);
} else {
}
switch (effect_type) {
- case CM_RINGER_EFFECT_CONNECT_TONE_E:
- effect_path = g_strdup(CALLMGR_PLAY_CONNECT_EFFECT_PATH);
- break;
- case CM_RINGER_EFFECT_DISCONNECT_TONE_E:
- effect_path = g_strdup(CALLMGR_PLAY_DISCONNECT_EFFECT_PATH);
- break;
- default:
- err("Invalid effect type[%d]", effect_type);
- return -1;
+ case CM_RINGER_EFFECT_CONNECT_TONE_E:
+ effect_path = g_strdup(CALLMGR_PLAY_CONNECT_EFFECT_PATH);
+ break;
+ case CM_RINGER_EFFECT_DISCONNECT_TONE_E:
+ effect_path = g_strdup(CALLMGR_PLAY_DISCONNECT_EFFECT_PATH);
+ break;
+ default:
+ err("Invalid effect type[%d]", effect_type);
+ return -1;
}
ret = wav_player_start_with_stream_info((const char *)effect_path, ringer_handle->ringtone_stream_handle, __callmgr_ringer_play_effect_finish_cb, (void *)ringer_handle, &(ringer_handle->play_effect_handle));
ringer_handle->current_status = CM_RINGER_STATUS_RINGING_E;
return 0;
- }
+}
int _callmgr_ringer_stop_effect(callmgr_ringer_handle_h ringer_handle)
{
int salescode = 0;
_callmgr_vconf_get_salescode(&salescode);
- if(salescode == CALL_CSC_TMB) {
+ if (salescode == CALL_CSC_TMB) {
/* In case that mcc, mnc value is invalid for TMO */
warn("TMB");
mcc = CALL_NETWORK_MCC_USA;
/* Make wait call list */
switch (event_type) {
- case CM_TELEPHONY_EVENT_ACTIVE:
- {
- CM_RETURN_VAL_IF_FAIL(active_call, -1);
- modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, active_call);
- break;
- }
- case CM_TELEPHONY_EVENT_HELD:
- {
- CM_RETURN_VAL_IF_FAIL(active_call, -1);
- if (active_call->is_conference) {
- call_list = modem_info->call_list;
- while (call_list) {
- call_data = (cm_telephony_call_data_t*)call_list->data;
- if ((call_data) && (call_data->is_conference)) {
- modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, call_data);
- }
- call_list = g_slist_next(call_list);
- }
- } else {
- modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, active_call);
- }
- break;
- }
- case CM_TELEPHONY_EVENT_JOIN:
- {
- CM_RETURN_VAL_IF_FAIL(held_call, -1);
- if (held_call->is_conference) {
- call_list = modem_info->call_list;
- while (call_list) {
- call_data = (cm_telephony_call_data_t*)call_list->data;
- if ((call_data) && (call_data->is_conference)) {
- modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, call_data);
- }
- call_list = g_slist_next(call_list);
+ case CM_TELEPHONY_EVENT_ACTIVE:
+ {
+ CM_RETURN_VAL_IF_FAIL(active_call, -1);
+ modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, active_call);
+ break;
+ }
+ case CM_TELEPHONY_EVENT_HELD:
+ {
+ CM_RETURN_VAL_IF_FAIL(active_call, -1);
+ if (active_call->is_conference) {
+ call_list = modem_info->call_list;
+ while (call_list) {
+ call_data = (cm_telephony_call_data_t*)call_list->data;
+ if ((call_data) && (call_data->is_conference)) {
+ modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, call_data);
}
- } else {
- modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, held_call);
+ call_list = g_slist_next(call_list);
}
- break;
+ } else {
+ modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, active_call);
}
- case CM_TELEPHONY_EVENT_SPLIT:
- {
- CM_RETURN_VAL_IF_FAIL(active_call, -1);
+ break;
+ }
+ case CM_TELEPHONY_EVENT_JOIN:
+ {
+ CM_RETURN_VAL_IF_FAIL(held_call, -1);
+ if (held_call->is_conference) {
call_list = modem_info->call_list;
while (call_list) {
call_data = (cm_telephony_call_data_t*)call_list->data;
- if ((call_data) && (call_data->call_id != active_call->call_id)) {
+ if ((call_data) && (call_data->is_conference)) {
modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, call_data);
}
call_list = g_slist_next(call_list);
}
- break;
+ } else {
+ modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, held_call);
}
- case CM_TELEPHONY_EVENT_RETRIEVED:
- {
- CM_RETURN_VAL_IF_FAIL(held_call, -1);
- if (held_call->is_conference) {
- call_list = modem_info->call_list;
- while (call_list) {
- call_data = (cm_telephony_call_data_t*)call_list->data;
- if ((call_data) && (call_data->is_conference)) {
- modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, call_data);
- }
- call_list = g_slist_next(call_list);
- }
- } else {
- modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, held_call);
+ break;
+ }
+ case CM_TELEPHONY_EVENT_SPLIT:
+ {
+ CM_RETURN_VAL_IF_FAIL(active_call, -1);
+ call_list = modem_info->call_list;
+ while (call_list) {
+ call_data = (cm_telephony_call_data_t*)call_list->data;
+ if ((call_data) && (call_data->call_id != active_call->call_id)) {
+ modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, call_data);
}
- break;
+ call_list = g_slist_next(call_list);
}
- case CM_TELEPHONY_EVENT_SWAP:
- {
- /* All call data should be appended to wait list in SWAP case */
+ break;
+ }
+ case CM_TELEPHONY_EVENT_RETRIEVED:
+ {
+ CM_RETURN_VAL_IF_FAIL(held_call, -1);
+ if (held_call->is_conference) {
call_list = modem_info->call_list;
while (call_list) {
call_data = (cm_telephony_call_data_t*)call_list->data;
- if (call_data) {
+ if ((call_data) && (call_data->is_conference)) {
modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, call_data);
}
call_list = g_slist_next(call_list);
}
- break;
+ } else {
+ modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, held_call);
}
- default:
- err("unhandled event type: %d", event_type);
- return -1;
+ break;
+ }
+ case CM_TELEPHONY_EVENT_SWAP:
+ {
+ /* All call data should be appended to wait list in SWAP case */
+ call_list = modem_info->call_list;
+ while (call_list) {
+ call_data = (cm_telephony_call_data_t*)call_list->data;
+ if (call_data) {
+ modem_info->wait_call_list = g_slist_append(modem_info->wait_call_list, call_data);
+ }
+ call_list = g_slist_next(call_list);
+ }
+ break;
+ }
+ default:
+ err("unhandled event type: %d", event_type);
+ return -1;
}
modem_info->wait_event = event_type;
}
switch (card_type) {
- case TAPI_SIM_CARD_TYPE_GSM:
- cm_card_type = CM_CARD_TYPE_GSM;
- break;
- case TAPI_SIM_CARD_TYPE_USIM:
- cm_card_type = CM_CARD_TYPE_USIM;
- break;
- case TAPI_SIM_CARD_TYPE_RUIM:
- case TAPI_SIM_CARD_TYPE_NVSIM:
- case TAPI_SIM_CARD_TYPE_IMS:
- default:
- cm_card_type = CM_CARD_TYPE_UNKNOWN;
- break;
+ case TAPI_SIM_CARD_TYPE_GSM:
+ cm_card_type = CM_CARD_TYPE_GSM;
+ break;
+ case TAPI_SIM_CARD_TYPE_USIM:
+ cm_card_type = CM_CARD_TYPE_USIM;
+ break;
+ case TAPI_SIM_CARD_TYPE_RUIM:
+ case TAPI_SIM_CARD_TYPE_NVSIM:
+ case TAPI_SIM_CARD_TYPE_IMS:
+ default:
+ cm_card_type = CM_CARD_TYPE_UNKNOWN;
+ break;
}
info("card_type = %d", cm_card_type);
*card_type_out = cm_card_type;
modem_info->is_no_sim = TRUE;
modem_info->is_sim_poweroff = FALSE;
modem_info->is_sim_initialized = FALSE;
- } else if((*status == TAPI_SIM_STATUS_CARD_POWEROFF)){
+ } else if ((*status == TAPI_SIM_STATUS_CARD_POWEROFF)) {
info("SIM slot[%d] is powered-off", sim_slot);
modem_info->is_sim_poweroff = TRUE;
modem_info->is_sim_initialized = FALSE;
- }else {
+ } else {
modem_info->is_no_sim = FALSE;
modem_info->is_sim_poweroff = FALSE;
if (*status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
}
}
- info("sim[%d], event_type:[%s]",slot_id, noti_id);
+ info("sim[%d], event_type:[%s]", slot_id, noti_id);
if (slot_id != -1) {
modem_info = &telephony_handle->modem_info[slot_id];
TelNetworkServiceType_t *service_type = (TelNetworkServiceType_t *)data;
info("Service Type: [%d]", *service_type);
switch (*service_type) {
- case TAPI_NETWORK_SERVICE_TYPE_UNKNOWN:
- case TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE:
- case TAPI_NETWORK_SERVICE_TYPE_SEARCH:
- modem_info->network_status = CM_NETWORK_STATUS_OUT_OF_SERVICE;
- break;
- case TAPI_NETWORK_SERVICE_TYPE_EMERGENCY:
- modem_info->network_status = CM_NETWORK_STATUS_EMERGENCY_ONLY;
- break;
- case TAPI_NETWORK_SERVICE_TYPE_2G:
- case TAPI_NETWORK_SERVICE_TYPE_2_5G:
- case TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE:
- modem_info->network_status = CM_NETWORK_STATUS_IN_SERVICE_2G;
- break;
- case TAPI_NETWORK_SERVICE_TYPE_3G:
- case TAPI_NETWORK_SERVICE_TYPE_HSDPA:
- case TAPI_NETWORK_SERVICE_TYPE_LTE:
- modem_info->network_status = CM_NETWORK_STATUS_IN_SERVICE_3G;
- break;
- default:
- modem_info->network_status = CM_NETWORK_STATUS_IN_SERVICE_2G; /* Please check default value*/
- break;
+ case TAPI_NETWORK_SERVICE_TYPE_UNKNOWN:
+ case TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE:
+ case TAPI_NETWORK_SERVICE_TYPE_SEARCH:
+ modem_info->network_status = CM_NETWORK_STATUS_OUT_OF_SERVICE;
+ break;
+ case TAPI_NETWORK_SERVICE_TYPE_EMERGENCY:
+ modem_info->network_status = CM_NETWORK_STATUS_EMERGENCY_ONLY;
+ break;
+ case TAPI_NETWORK_SERVICE_TYPE_2G:
+ case TAPI_NETWORK_SERVICE_TYPE_2_5G:
+ case TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE:
+ modem_info->network_status = CM_NETWORK_STATUS_IN_SERVICE_2G;
+ break;
+ case TAPI_NETWORK_SERVICE_TYPE_3G:
+ case TAPI_NETWORK_SERVICE_TYPE_HSDPA:
+ case TAPI_NETWORK_SERVICE_TYPE_LTE:
+ modem_info->network_status = CM_NETWORK_STATUS_IN_SERVICE_3G;
+ break;
+ default:
+ modem_info->network_status = CM_NETWORK_STATUS_IN_SERVICE_2G; /* Please check default value*/
+ break;
}
} else if (g_strcmp0(noti_id, TAPI_PROP_NETWORK_CIRCUIT_STATUS) == 0) {
int *cs_status = (int *)data;
info("active_sim_slot[%d], request_sim_slot[%d]", active_sim_slot, request_sim_slot);
- if(CM_TELEPHONY_SIM_UNKNOWN == active_sim_slot) {
+ if (CM_TELEPHONY_SIM_UNKNOWN == active_sim_slot) {
_callmgr_telephony_set_active_sim_slot(telephony_handle, request_sim_slot);
active_sim_slot = request_sim_slot;
}
if (request_sim_slot != active_sim_slot) {
int ret = 0, call_count = 0;
ret = _callmgr_telephony_get_call_count(telephony_handle, &call_count);
- if ( ret == 0 && call_count == 0) {
+ if (ret == 0 && call_count == 0) {
// change active_sim_slot only when there is no other call
_callmgr_telephony_set_active_sim_slot(telephony_handle, request_sim_slot);
} else {
dbg("MO_VOICE call control call address[%s]", ind_data->u.callCtrlCnfCallData.address.string);
}
- if(request_sim_slot != active_sim_slot) {
+ if (request_sim_slot != active_sim_slot) {
err("request came for wrong sim_slot");
}
info("event_type[%d], resp_type[%d]", event_type, resp_type);
- if(CM_TELEPHONY_SIM_UNKNOWN == active_sim_slot) {
+ if (CM_TELEPHONY_SIM_UNKNOWN == active_sim_slot) {
current_active_sim_slot = telephony_handle->active_sim_slot;
} else {
current_active_sim_slot = active_sim_slot;
switch (event_type) {
case CM_TELEPHONY_SAT_EVENT_SETUP_CALL:
- {
- TelSatCallRetInfo_t call_resp_data = {0,};
- TelSatAppsRetInfo_t resp_data = {0,};
- TapiResult_t error_code;
- CM_RETURN_IF_FAIL(sat_data->setup_call);
-
- memset(&resp_data, 0, sizeof(TelSatAppsRetInfo_t));
-
- switch (resp_type) {
- case CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND:
- call_resp_data.resp = TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND;
- call_resp_data.bIsTapiCauseExist = FALSE;
- call_resp_data.tapiCause = TAPI_CAUSE_UNKNOWN;
- call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL;
- call_resp_data.bIsOtherInfoExist = FALSE;
- call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- call_resp_data.resp = TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- call_resp_data.bIsTapiCauseExist = TRUE;
- call_resp_data.tapiCause = TAPI_CAUSE_BUSY;
- call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_NO_SERVICE;
- call_resp_data.bIsOtherInfoExist = FALSE;
- call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_NETWORK_UNABLE_TO_PROCESS_COMMAND_WITHOUT_CAUSE:
- call_resp_data.resp = TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- call_resp_data.bIsTapiCauseExist = FALSE;
- call_resp_data.tapiCause = TAPI_CAUSE_UNKNOWN;
- call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
- call_resp_data.bIsOtherInfoExist = FALSE;
- call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_ME_CONTROL_PERMANENT_PROBLEM:
- call_resp_data.resp = TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
- call_resp_data.bIsTapiCauseExist = FALSE;
- call_resp_data.tapiCause = TAPI_CAUSE_UNKNOWN;
- call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_ACCESS_CONTROL_CLASS_BAR;
- call_resp_data.bIsOtherInfoExist = FALSE;
- call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_ACTION_NOT_ALLOWED;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_ME_CLEAR_DOWN_BEFORE_CONN:
- call_resp_data.resp = TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
- call_resp_data.bIsTapiCauseExist = FALSE;
- call_resp_data.tapiCause = TAPI_CAUSE_UNKNOWN;
- call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL;
- call_resp_data.bIsOtherInfoExist = FALSE;
- call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_ME_RET_SUCCESS:
- call_resp_data.resp = TAPI_SAT_R_SUCCESS;
- call_resp_data.bIsTapiCauseExist = TRUE;
- call_resp_data.tapiCause = TAPI_CAUSE_SUCCESS;
- call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
- call_resp_data.bIsOtherInfoExist = FALSE;
- call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- default:
- warn("unhandled resp_type[%d].", resp_type);
- break;
- }
- resp_data.commandType = TAPI_SAT_CMD_TYPE_SETUP_CALL;
- resp_data.commandId = sat_data->setup_call->commandId;
- memcpy(&(resp_data.appsRet.setupCall), &call_resp_data, sizeof(resp_data.appsRet.setupCall));
-
- error_code = tel_send_sat_app_exec_result(telephony_handle->multi_handles[current_active_sim_slot], &resp_data);
- if (error_code != TAPI_API_SUCCESS) {
- err("tel_send_sat_app_exec_result() is failed[%d].", error_code);
- }
+ {
+ TelSatCallRetInfo_t call_resp_data = {0,};
+ TelSatAppsRetInfo_t resp_data = {0,};
+ TapiResult_t error_code;
+ CM_RETURN_IF_FAIL(sat_data->setup_call);
+
+ memset(&resp_data, 0, sizeof(TelSatAppsRetInfo_t));
+
+ switch (resp_type) {
+ case CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND:
+ call_resp_data.resp = TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND;
+ call_resp_data.bIsTapiCauseExist = FALSE;
+ call_resp_data.tapiCause = TAPI_CAUSE_UNKNOWN;
+ call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL;
+ call_resp_data.bIsOtherInfoExist = FALSE;
+ call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ call_resp_data.resp = TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+ call_resp_data.bIsTapiCauseExist = TRUE;
+ call_resp_data.tapiCause = TAPI_CAUSE_BUSY;
+ call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_NO_SERVICE;
+ call_resp_data.bIsOtherInfoExist = FALSE;
+ call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_NETWORK_UNABLE_TO_PROCESS_COMMAND_WITHOUT_CAUSE:
+ call_resp_data.resp = TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+ call_resp_data.bIsTapiCauseExist = FALSE;
+ call_resp_data.tapiCause = TAPI_CAUSE_UNKNOWN;
+ call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ call_resp_data.bIsOtherInfoExist = FALSE;
+ call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_ME_CONTROL_PERMANENT_PROBLEM:
+ call_resp_data.resp = TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
+ call_resp_data.bIsTapiCauseExist = FALSE;
+ call_resp_data.tapiCause = TAPI_CAUSE_UNKNOWN;
+ call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_ACCESS_CONTROL_CLASS_BAR;
+ call_resp_data.bIsOtherInfoExist = FALSE;
+ call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_ACTION_NOT_ALLOWED;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_ME_CLEAR_DOWN_BEFORE_CONN:
+ call_resp_data.resp = TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
+ call_resp_data.bIsTapiCauseExist = FALSE;
+ call_resp_data.tapiCause = TAPI_CAUSE_UNKNOWN;
+ call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL;
+ call_resp_data.bIsOtherInfoExist = FALSE;
+ call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_ME_RET_SUCCESS:
+ call_resp_data.resp = TAPI_SAT_R_SUCCESS;
+ call_resp_data.bIsTapiCauseExist = TRUE;
+ call_resp_data.tapiCause = TAPI_CAUSE_SUCCESS;
+ call_resp_data.meProblem = TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ call_resp_data.bIsOtherInfoExist = FALSE;
+ call_resp_data.permanentCallCtrlProblem = TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+ default:
+ warn("unhandled resp_type[%d].", resp_type);
+ break;
+ }
+ resp_data.commandType = TAPI_SAT_CMD_TYPE_SETUP_CALL;
+ resp_data.commandId = sat_data->setup_call->commandId;
+ memcpy(&(resp_data.appsRet.setupCall), &call_resp_data, sizeof(resp_data.appsRet.setupCall));
- g_free(sat_data->setup_call);
- sat_data->setup_call = NULL;
+ error_code = tel_send_sat_app_exec_result(telephony_handle->multi_handles[current_active_sim_slot], &resp_data);
+ if (error_code != TAPI_API_SUCCESS) {
+ err("tel_send_sat_app_exec_result() is failed[%d].", error_code);
}
+
+ g_free(sat_data->setup_call);
+ sat_data->setup_call = NULL;
+ }
break;
case CM_TELEPHONY_SAT_EVENT_SEND_DTMF:
- {
- TelSatDtmfRetInfo_t dtmf_resp_data = {0,};
- TelSatAppsRetInfo_t resp_data = {0,};
- TapiResult_t error_code;
- CM_RETURN_IF_FAIL(sat_data->send_dtmf);
+ {
+ TelSatDtmfRetInfo_t dtmf_resp_data = {0,};
+ TelSatAppsRetInfo_t resp_data = {0,};
+ TapiResult_t error_code;
+ CM_RETURN_IF_FAIL(sat_data->send_dtmf);
- memset(&resp_data, 0, sizeof(TelSatAppsRetInfo_t));
+ memset(&resp_data, 0, sizeof(TelSatAppsRetInfo_t));
- switch (resp_type) {
- case CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND:
- dtmf_resp_data.resp = TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- dtmf_resp_data.resp = TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_ME_CONTROL_PERMANENT_PROBLEM:
- dtmf_resp_data.resp = TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_ME_CLEAR_DOWN_BEFORE_CONN:
- dtmf_resp_data.resp = TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
- break;
- case CM_TELEPHONY_SAT_RESPONSE_ME_RET_SUCCESS:
- dtmf_resp_data.resp = TAPI_SAT_R_SUCCESS;
- break;
- default:
- warn("unhandled resp_type[%d].", resp_type);
- break;
- }
- resp_data.commandType = TAPI_SAT_CMD_TYPE_SEND_DTMF;
- resp_data.commandId = sat_data->send_dtmf->commandId;
- memcpy(&(resp_data.appsRet.sendDtmf), &dtmf_resp_data, sizeof(resp_data.appsRet.sendDtmf));
-
- error_code = tel_send_sat_app_exec_result(telephony_handle->multi_handles[current_active_sim_slot], &resp_data);
- if (error_code != TAPI_API_SUCCESS) {
- err("tel_send_sat_app_exec_result() is failed[%d].", error_code);
- }
+ switch (resp_type) {
+ case CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND:
+ dtmf_resp_data.resp = TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ dtmf_resp_data.resp = TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_ME_CONTROL_PERMANENT_PROBLEM:
+ dtmf_resp_data.resp = TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_ME_CLEAR_DOWN_BEFORE_CONN:
+ dtmf_resp_data.resp = TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
+ break;
+ case CM_TELEPHONY_SAT_RESPONSE_ME_RET_SUCCESS:
+ dtmf_resp_data.resp = TAPI_SAT_R_SUCCESS;
+ break;
+ default:
+ warn("unhandled resp_type[%d].", resp_type);
+ break;
+ }
+ resp_data.commandType = TAPI_SAT_CMD_TYPE_SEND_DTMF;
+ resp_data.commandId = sat_data->send_dtmf->commandId;
+ memcpy(&(resp_data.appsRet.sendDtmf), &dtmf_resp_data, sizeof(resp_data.appsRet.sendDtmf));
- g_free(sat_data->send_dtmf);
- sat_data->send_dtmf = NULL;
+ error_code = tel_send_sat_app_exec_result(telephony_handle->multi_handles[current_active_sim_slot], &resp_data);
+ if (error_code != TAPI_API_SUCCESS) {
+ err("tel_send_sat_app_exec_result() is failed[%d].", error_code);
}
+
+ g_free(sat_data->send_dtmf);
+ sat_data->send_dtmf = NULL;
+ }
break;
case CM_TELEPHONY_SAT_EVENT_CALL_CONTROL_RESULT:
default:
if (TAPI_API_SUCCESS == ret) {
info("svc_type = [%d]", svc_type);
switch (svc_type) {
- case TAPI_NETWORK_SERVICE_TYPE_UNKNOWN:
- case TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE:
- case TAPI_NETWORK_SERVICE_TYPE_SEARCH:
- *cm_svc_type = CM_NETWORK_STATUS_OUT_OF_SERVICE;
- break;
- case TAPI_NETWORK_SERVICE_TYPE_EMERGENCY:
- *cm_svc_type = CM_NETWORK_STATUS_EMERGENCY_ONLY;
- break;
- case TAPI_NETWORK_SERVICE_TYPE_2G:
- case TAPI_NETWORK_SERVICE_TYPE_2_5G:
- case TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE:
- *cm_svc_type = CM_NETWORK_STATUS_IN_SERVICE_2G;
- break;
- case TAPI_NETWORK_SERVICE_TYPE_3G:
- case TAPI_NETWORK_SERVICE_TYPE_HSDPA:
- case TAPI_NETWORK_SERVICE_TYPE_LTE:
- *cm_svc_type = CM_NETWORK_STATUS_IN_SERVICE_3G;
- break;
- default:
- *cm_svc_type = CM_NETWORK_STATUS_IN_SERVICE_2G; /* Please check default value*/
- break;
+ case TAPI_NETWORK_SERVICE_TYPE_UNKNOWN:
+ case TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE:
+ case TAPI_NETWORK_SERVICE_TYPE_SEARCH:
+ *cm_svc_type = CM_NETWORK_STATUS_OUT_OF_SERVICE;
+ break;
+ case TAPI_NETWORK_SERVICE_TYPE_EMERGENCY:
+ *cm_svc_type = CM_NETWORK_STATUS_EMERGENCY_ONLY;
+ break;
+ case TAPI_NETWORK_SERVICE_TYPE_2G:
+ case TAPI_NETWORK_SERVICE_TYPE_2_5G:
+ case TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE:
+ *cm_svc_type = CM_NETWORK_STATUS_IN_SERVICE_2G;
+ break;
+ case TAPI_NETWORK_SERVICE_TYPE_3G:
+ case TAPI_NETWORK_SERVICE_TYPE_HSDPA:
+ case TAPI_NETWORK_SERVICE_TYPE_LTE:
+ *cm_svc_type = CM_NETWORK_STATUS_IN_SERVICE_3G;
+ break;
+ default:
+ *cm_svc_type = CM_NETWORK_STATUS_IN_SERVICE_2G; /* Please check default value*/
+ break;
}
return 0;
} else {
switch (ans_type) {
case CM_TEL_CALL_ANSWER_TYPE_NORMAL:
- {
- ret = tel_answer_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], incoming_call_id, TAPI_CALL_ANSWER_ACCEPT, __callmgr_telephony_answer_call_resp_cb, telephony_handle);
- if (ret != TAPI_API_SUCCESS) {
- err("_callmgr_telephony_answer_call failed with err: %d", ret);
- return -1;
- }
- __callmgr_telephony_set_answer_requesting(telephony_handle, TRUE);
+ {
+ ret = tel_answer_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], incoming_call_id, TAPI_CALL_ANSWER_ACCEPT, __callmgr_telephony_answer_call_resp_cb, telephony_handle);
+ if (ret != TAPI_API_SUCCESS) {
+ err("_callmgr_telephony_answer_call failed with err: %d", ret);
+ return -1;
}
+ __callmgr_telephony_set_answer_requesting(telephony_handle, TRUE);
+ }
break;
case CM_TEL_CALL_ANSWER_TYPE_HOLD_ACTIVE_AND_ACCEPT:
- {
- ret = tel_answer_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], incoming_call_id, TAPI_CALL_ANSWER_HOLD_AND_ACCEPT, __callmgr_telephony_answer_call_resp_cb, telephony_handle);
- if (ret != TAPI_API_SUCCESS) {
- err("_callmgr_telephony_answer_call failed with err: %d", ret);
- return -1;
- }
- __callmgr_telephony_set_answer_requesting(telephony_handle, TRUE);
-
+ {
+ ret = tel_answer_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], incoming_call_id, TAPI_CALL_ANSWER_HOLD_AND_ACCEPT, __callmgr_telephony_answer_call_resp_cb, telephony_handle);
+ if (ret != TAPI_API_SUCCESS) {
+ err("_callmgr_telephony_answer_call failed with err: %d", ret);
+ return -1;
}
+ __callmgr_telephony_set_answer_requesting(telephony_handle, TRUE);
+
+ }
break;
case CM_TEL_CALL_ANSWER_TYPE_RELEASE_ACTIVE_AND_ACCEPT:
- {
- ret = tel_answer_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], incoming_call_id, TAPI_CALL_ANSWER_REPLACE, __callmgr_telephony_answer_call_resp_cb, telephony_handle);
- if (ret != TAPI_API_SUCCESS) {
- err("_callmgr_telephony_answer_call failed with err: %d", ret);
- return -1;
- }
- __callmgr_telephony_set_answer_requesting(telephony_handle, TRUE);
+ {
+ ret = tel_answer_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], incoming_call_id, TAPI_CALL_ANSWER_REPLACE, __callmgr_telephony_answer_call_resp_cb, telephony_handle);
+ if (ret != TAPI_API_SUCCESS) {
+ err("_callmgr_telephony_answer_call failed with err: %d", ret);
+ return -1;
}
+ __callmgr_telephony_set_answer_requesting(telephony_handle, TRUE);
+ }
break;
case CM_TEL_CALL_ANSWER_TYPE_RELEASE_HOLD_AND_ACCEPT:
- {
- __callmgr_telephony_end_all_call_by_state(telephony_handle, CM_TEL_CALL_STATE_HELD);
- _callmgr_telephony_set_answer_request_type(telephony_handle, CM_TEL_HOLD_ACTIVE_AFTER_HELD_END);
- __callmgr_telephony_set_answer_requesting(telephony_handle, TRUE);
- }
+ {
+ __callmgr_telephony_end_all_call_by_state(telephony_handle, CM_TEL_CALL_STATE_HELD);
+ _callmgr_telephony_set_answer_request_type(telephony_handle, CM_TEL_HOLD_ACTIVE_AFTER_HELD_END);
+ __callmgr_telephony_set_answer_requesting(telephony_handle, TRUE);
+ }
break;
case CM_TEL_CALL_ANSWER_TYPE_RELEASE_ALL_AND_ACCEPT:
switch (release_type) {
case CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE:
- {
- cm_telephony_call_data_t *call_data = NULL;
- if (_callmgr_telephony_get_call_by_call_id(telephony_handle, call_id, &call_data) < 0) {
- err("No call_data exists for this event...");
- } else {
- /*******************************************
- * To handle Canceled outgoing call.
- * call-ui must call release by call handle,
- * in case of ending dilaing call
- ********************************************/
- if (call_data->call_state == CM_TEL_CALL_STATE_DIALING ||
- call_data->call_state == CM_TEL_CALL_STATE_ALERT) {
- __callmgr_telephony_set_call_canceled_flag(call_data, TRUE);
- }
+ {
+ cm_telephony_call_data_t *call_data = NULL;
+ if (_callmgr_telephony_get_call_by_call_id(telephony_handle, call_id, &call_data) < 0) {
+ err("No call_data exists for this event...");
+ } else {
+ /*******************************************
+ * To handle Canceled outgoing call.
+ * call-ui must call release by call handle,
+ * in case of ending dilaing call
+ ********************************************/
+ if (call_data->call_state == CM_TEL_CALL_STATE_DIALING ||
+ call_data->call_state == CM_TEL_CALL_STATE_ALERT) {
+ __callmgr_telephony_set_call_canceled_flag(call_data, TRUE);
}
+ }
- ret_tapi = tel_end_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], call_id, TAPI_CALL_END, __callmgr_telephony_end_call_resp_cb, telephony_handle);
- if (ret_tapi != TAPI_API_SUCCESS) {
- err("tel_end_call() get failed with err: %d", ret);
- return -1;
- }
+ ret_tapi = tel_end_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], call_id, TAPI_CALL_END, __callmgr_telephony_end_call_resp_cb, telephony_handle);
+ if (ret_tapi != TAPI_API_SUCCESS) {
+ err("tel_end_call() get failed with err: %d", ret);
+ return -1;
}
+ }
break;
case CM_TEL_CALL_RELEASE_TYPE_ALL_CALLS:
- {
- ret_tapi = tel_end_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], call_id, TAPI_CALL_END_ALL, __callmgr_telephony_end_call_resp_cb, telephony_handle);
- if (ret_tapi != TAPI_API_SUCCESS) {
- err("tel_end_call() get failed with err: %d", ret);
- return -1;
- }
+ {
+ ret_tapi = tel_end_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], call_id, TAPI_CALL_END_ALL, __callmgr_telephony_end_call_resp_cb, telephony_handle);
+ if (ret_tapi != TAPI_API_SUCCESS) {
+ err("tel_end_call() get failed with err: %d", ret);
+ return -1;
}
+ }
break;
case CM_TEL_CALL_RELEASE_TYPE_ALL_HOLD_CALLS:
- {
- ret_tapi = tel_end_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], call_id, TAPI_CALL_END_HOLD_ALL, __callmgr_telephony_end_call_resp_cb, telephony_handle);
- if (ret_tapi != TAPI_API_SUCCESS) {
- err("tel_end_call() get failed with err: %d", ret);
- return -1;
- }
+ {
+ ret_tapi = tel_end_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], call_id, TAPI_CALL_END_HOLD_ALL, __callmgr_telephony_end_call_resp_cb, telephony_handle);
+ if (ret_tapi != TAPI_API_SUCCESS) {
+ err("tel_end_call() get failed with err: %d", ret);
+ return -1;
}
+ }
break;
case CM_TEL_CALL_RELEASE_TYPE_ALL_ACTIVE_CALLS:
- {
- struct __modem_info *modem_info = NULL;
- GSList *call_list = NULL;
- cm_telephony_call_data_t *call_obj = NULL;
- cm_telephony_call_state_e call_state = CM_TEL_CALL_STATE_MAX;
- unsigned int call_id = 0;
-
- modem_info = &telephony_handle->modem_info[telephony_handle->active_sim_slot];
- call_list = modem_info->call_list;
-
- while (call_list) {
- call_obj = (cm_telephony_call_data_t*)call_list->data;
- if (!call_obj) {
- warn("[ error ] call object : 0");
- call_list = call_list->next;
- continue;
- }
+ {
+ struct __modem_info *modem_info = NULL;
+ GSList *call_list = NULL;
+ cm_telephony_call_data_t *call_obj = NULL;
+ cm_telephony_call_state_e call_state = CM_TEL_CALL_STATE_MAX;
+ unsigned int call_id = 0;
+
+ modem_info = &telephony_handle->modem_info[telephony_handle->active_sim_slot];
+ call_list = modem_info->call_list;
+
+ while (call_list) {
+ call_obj = (cm_telephony_call_data_t*)call_list->data;
+ if (!call_obj) {
+ warn("[ error ] call object : 0");
+ call_list = call_list->next;
+ continue;
+ }
- call_id = call_obj->call_id;
- call_state = call_obj->call_state;
+ call_id = call_obj->call_id;
+ call_state = call_obj->call_state;
- dbg("call_id = %d call_state = %d", call_id, call_state);
- call_list = g_slist_next(call_list);
- if (call_state == CM_TEL_CALL_STATE_ACTIVE) {
- ret_tapi = tel_end_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], call_id, TAPI_CALL_END, __callmgr_telephony_end_call_resp_cb, NULL);
- if (ret_tapi != TAPI_API_SUCCESS) {
- err("tel_end_call() get failed with err: %d", ret);
- return -1;
- }
+ dbg("call_id = %d call_state = %d", call_id, call_state);
+ call_list = g_slist_next(call_list);
+ if (call_state == CM_TEL_CALL_STATE_ACTIVE) {
+ ret_tapi = tel_end_call(telephony_handle->multi_handles[telephony_handle->active_sim_slot], call_id, TAPI_CALL_END, __callmgr_telephony_end_call_resp_cb, NULL);
+ if (ret_tapi != TAPI_API_SUCCESS) {
+ err("tel_end_call() get failed with err: %d", ret);
+ return -1;
}
}
}
+ }
break;
default:
err("wrong release_type");
info("call state [%d]", out->CallState);
switch (out->CallState) {
- case TAPI_CALL_STATE_IDLE:
- call_state = CM_TEL_CALL_STATE_IDLE;
- break;
- case TAPI_CALL_STATE_ACTIVE:
- call_state = CM_TEL_CALL_STATE_ACTIVE;
- break;
- case TAPI_CALL_STATE_HELD:
- call_state = CM_TEL_CALL_STATE_HELD;
- break;
- case TAPI_CALL_STATE_DIALING:
- call_state = CM_TEL_CALL_STATE_DIALING;
- break;
- case TAPI_CALL_STATE_ALERT:
- call_state = CM_TEL_CALL_STATE_ALERT;
- break;
- case TAPI_CALL_STATE_INCOMING:
- case TAPI_CALL_STATE_WAITING:
- call_state = CM_TEL_CALL_STATE_INCOMING;
- break;
- default:
- err("should not reach here");
- break;
+ case TAPI_CALL_STATE_IDLE:
+ call_state = CM_TEL_CALL_STATE_IDLE;
+ break;
+ case TAPI_CALL_STATE_ACTIVE:
+ call_state = CM_TEL_CALL_STATE_ACTIVE;
+ break;
+ case TAPI_CALL_STATE_HELD:
+ call_state = CM_TEL_CALL_STATE_HELD;
+ break;
+ case TAPI_CALL_STATE_DIALING:
+ call_state = CM_TEL_CALL_STATE_DIALING;
+ break;
+ case TAPI_CALL_STATE_ALERT:
+ call_state = CM_TEL_CALL_STATE_ALERT;
+ break;
+ case TAPI_CALL_STATE_INCOMING:
+ case TAPI_CALL_STATE_WAITING:
+ call_state = CM_TEL_CALL_STATE_INCOMING;
+ break;
+ default:
+ err("should not reach here");
+ break;
}
__callmgr_telephony_set_call_state(call_data, call_state);
CM_RETURN_VAL_IF_FAIL(telephony_handle, -1);
CM_RETURN_VAL_IF_FAIL(b_is_ongoing, -1);
- switch(event_type) {
+ switch (event_type) {
case CM_TELEPHONY_SAT_EVENT_SETUP_CALL:
if (telephony_handle->modem_info[telephony_handle->active_sim_slot].sat_data.setup_call)
*b_is_ongoing = TRUE;
} else {
info("preferred_subscription: %d", preferred_subscription);
switch (preferred_subscription) {
- case TAPI_CALL_PREFERRED_VOICE_SUBS_CURRENT_NETWORK:
- *preferred_sim = CM_TEL_PREFERRED_CURRENT_NETWORK_E;
- break;
- case TAPI_CALL_PREFERRED_VOICE_SUBS_ASK_ALWAYS:
- *preferred_sim = CM_TEL_PREFERRED_ALWAYS_ASK_E;
- break;
- case TAPI_CALL_PREFERRED_VOICE_SUBS_SIM1:
- *preferred_sim = CM_TEL_PREFERRED_SIM_1_E;
- break;
- case TAPI_CALL_PREFERRED_VOICE_SUBS_SIM2:
- *preferred_sim = CM_TEL_PREFERRED_SIM_2_E;
- break;
- default:
- *preferred_sim = CM_TEL_PREFERRED_UNKNOWN_E;
- break;
+ case TAPI_CALL_PREFERRED_VOICE_SUBS_CURRENT_NETWORK:
+ *preferred_sim = CM_TEL_PREFERRED_CURRENT_NETWORK_E;
+ break;
+ case TAPI_CALL_PREFERRED_VOICE_SUBS_ASK_ALWAYS:
+ *preferred_sim = CM_TEL_PREFERRED_ALWAYS_ASK_E;
+ break;
+ case TAPI_CALL_PREFERRED_VOICE_SUBS_SIM1:
+ *preferred_sim = CM_TEL_PREFERRED_SIM_1_E;
+ break;
+ case TAPI_CALL_PREFERRED_VOICE_SUBS_SIM2:
+ *preferred_sim = CM_TEL_PREFERRED_SIM_2_E;
+ break;
+ default:
+ *preferred_sim = CM_TEL_PREFERRED_UNKNOWN_E;
+ break;
}
}
return 0;
CM_RETURN_VAL_IF_FAIL(sim_slot < telephony_handle->modem_cnt, -1);
dbg("_callmgr_telephony_is_in_service()");
switch (telephony_handle->modem_info[sim_slot].network_status) {
- case CM_NETWORK_STATUS_OUT_OF_SERVICE:
- case CM_NETWORK_STATUS_EMERGENCY_ONLY:
- *is_in_service = FALSE;
- break;
- default:
- *is_in_service = TRUE;
- break;
+ case CM_NETWORK_STATUS_OUT_OF_SERVICE:
+ case CM_NETWORK_STATUS_EMERGENCY_ONLY:
+ *is_in_service = FALSE;
+ break;
+ default:
+ *is_in_service = TRUE;
+ break;
}
return 0;
}
/* step1. SIM power check for MultiSIM only. if one SIM is powered-off, use available SIM slot by default regardless SIM state */
- if(telephony_handle->modem_cnt > 1){
- for(idx =0;idx<telephony_handle->modem_cnt;idx++){
+ if (telephony_handle->modem_cnt > 1) {
+ for (idx = 0; idx < telephony_handle->modem_cnt; idx++) {
sim_power_off = telephony_handle->modem_info[idx].is_sim_poweroff;
- if(sim_power_off == TRUE){
- info("SIM %d powered off. choose alternative slot for emergency call",idx);
- if(idx == CM_TELEPHONY_SIM_1){
+ if (sim_power_off == TRUE) {
+ info("SIM %d powered off. choose alternative slot for emergency call", idx);
+ if (idx == CM_TELEPHONY_SIM_1) {
return _callmgr_telephony_set_active_sim_slot(telephony_handle, CM_TELEPHONY_SIM_2);
- }
- else if(idx == CM_TELEPHONY_SIM_2){
+ } else if (idx == CM_TELEPHONY_SIM_2) {
return _callmgr_telephony_set_active_sim_slot(telephony_handle, CM_TELEPHONY_SIM_1);
}
}
}
warn("(both)SIM slots are in No service, Check SIM ECC");
- if (__callmgr_telephony_check_ecc_slot(telephony_handle,pNumber, (cm_telepony_sim_slot_type_e *)&idx) == 0)
- {
+ if (__callmgr_telephony_check_ecc_slot(telephony_handle, pNumber, (cm_telepony_sim_slot_type_e *)&idx) == 0) {
warn("SIM has same ecc num");
_callmgr_telephony_set_active_sim_slot(telephony_handle, idx);
return 0;
info("simcard_type : %d", simcard_type);
switch (simcard_type) {
- case CM_CARD_TYPE_GSM:
- {
- dbg("[SimCardType=SIM_CARD_TYPE_GSM]");
-
- /*TAPI api Compliance */
- /*To get Emergency data of 2G */
- if (modem_info->sim_ecc_list.ecc_count > 0) {
- dbg("GSM pNumber ecc1(%s) ecc2(%s) ecc3(%s) ecc4(%s) ecc5(%s)",
- modem_info->sim_ecc_list.list[0].number, modem_info->sim_ecc_list.list[1].number, modem_info->sim_ecc_list.list[2].number, modem_info->sim_ecc_list.list[3].number, modem_info->sim_ecc_list.list[4].number);
-
- if ((g_strcmp0(pNumber, modem_info->sim_ecc_list.list[0].number) == 0)
- || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[1].number) == 0)
- || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[2].number) == 0)
- || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[3].number) == 0)
- || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[4].number) == 0)) {
- dbg("_callmgr_telephony_check_ecc_number: return TRUE");
- *sim_slot = sim_cnt;
- return 0;
- }
- }
+ case CM_CARD_TYPE_GSM:
+ {
+ dbg("[SimCardType=SIM_CARD_TYPE_GSM]");
+
+ /*TAPI api Compliance */
+ /*To get Emergency data of 2G */
+ if (modem_info->sim_ecc_list.ecc_count > 0) {
+ dbg("GSM pNumber ecc1(%s) ecc2(%s) ecc3(%s) ecc4(%s) ecc5(%s)",
+ modem_info->sim_ecc_list.list[0].number, modem_info->sim_ecc_list.list[1].number, modem_info->sim_ecc_list.list[2].number, modem_info->sim_ecc_list.list[3].number, modem_info->sim_ecc_list.list[4].number);
+
+ if ((g_strcmp0(pNumber, modem_info->sim_ecc_list.list[0].number) == 0)
+ || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[1].number) == 0)
+ || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[2].number) == 0)
+ || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[3].number) == 0)
+ || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[4].number) == 0)) {
+ dbg("_callmgr_telephony_check_ecc_number: return TRUE");
+ *sim_slot = sim_cnt;
+ return 0;
}
- break;
- case CM_CARD_TYPE_USIM:
- {
- dbg("SimCardType=SIM_CARD_TYPE_USIM");
-
- if (modem_info->sim_ecc_list.ecc_count > 0) {
- for (i = 0; i < modem_info->sim_ecc_list.ecc_count; i++) {
- dbg("[ecc=%s, category:[%d]]", modem_info->sim_ecc_list.list[i].number, modem_info->sim_ecc_list.list[i].category);
- if (!g_strcmp0(pNumber, modem_info->sim_ecc_list.list[i].number)) {
- dbg("uecc matched!!");
- *sim_slot = sim_cnt;
- return 0;
- }
- }
+ }
+ }
+ break;
+ case CM_CARD_TYPE_USIM:
+ {
+ dbg("SimCardType=SIM_CARD_TYPE_USIM");
+
+ if (modem_info->sim_ecc_list.ecc_count > 0) {
+ for (i = 0; i < modem_info->sim_ecc_list.ecc_count; i++) {
+ dbg("[ecc=%s, category:[%d]]", modem_info->sim_ecc_list.list[i].number, modem_info->sim_ecc_list.list[i].category);
+ if (!g_strcmp0(pNumber, modem_info->sim_ecc_list.list[i].number)) {
+ dbg("uecc matched!!");
+ *sim_slot = sim_cnt;
+ return 0;
}
}
- break;
- default:
- dbg("type : %d", simcard_type);
- break;
+ }
+ }
+ break;
+ default:
+ dbg("type : %d", simcard_type);
+ break;
}
}
/*_callmgr_telephony_get_imsi_mcc_mnc(telephony_handle, &imsi_mcc, &imsi_mnc);*/
switch (simcard_type) {
- case CM_CARD_TYPE_GSM:
- {
- dbg("[SimCardType=SIM_CARD_TYPE_GSM]");
-
- /*TAPI api Compliance */
- /*To get Emergency data of 2G */
- if (modem_info->sim_ecc_list.ecc_count > 0) {
- sec_dbg("GSM pNumber ecc1(%s) ecc2(%s) ecc3(%s) ecc4(%s) ecc5(%s)",
- modem_info->sim_ecc_list.list[0].number, modem_info->sim_ecc_list.list[1].number, modem_info->sim_ecc_list.list[2].number, modem_info->sim_ecc_list.list[3].number, modem_info->sim_ecc_list.list[4].number);
-
- if ((g_strcmp0(pNumber, modem_info->sim_ecc_list.list[0].number) == 0)
- || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[1].number) == 0)
- || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[2].number) == 0)
- || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[3].number) == 0)
- || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[4].number) == 0)) {
- dbg("_callmgr_telephony_check_ecc_number: return TRUE");
- *is_sim_ecc = TRUE;
- return 0;
- }
- }
+ case CM_CARD_TYPE_GSM:
+ {
+ dbg("[SimCardType=SIM_CARD_TYPE_GSM]");
+
+ /*TAPI api Compliance */
+ /*To get Emergency data of 2G */
+ if (modem_info->sim_ecc_list.ecc_count > 0) {
+ sec_dbg("GSM pNumber ecc1(%s) ecc2(%s) ecc3(%s) ecc4(%s) ecc5(%s)",
+ modem_info->sim_ecc_list.list[0].number, modem_info->sim_ecc_list.list[1].number, modem_info->sim_ecc_list.list[2].number, modem_info->sim_ecc_list.list[3].number, modem_info->sim_ecc_list.list[4].number);
+
+ if ((g_strcmp0(pNumber, modem_info->sim_ecc_list.list[0].number) == 0)
+ || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[1].number) == 0)
+ || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[2].number) == 0)
+ || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[3].number) == 0)
+ || (g_strcmp0(pNumber, modem_info->sim_ecc_list.list[4].number) == 0)) {
+ dbg("_callmgr_telephony_check_ecc_number: return TRUE");
+ *is_sim_ecc = TRUE;
+ return 0;
}
- break;
- case CM_CARD_TYPE_USIM:
- {
- dbg("SimCardType=SIM_CARD_TYPE_USIM");
-
- if (modem_info->sim_ecc_list.ecc_count > 0) {
- for (i = 0; i < modem_info->sim_ecc_list.ecc_count; i++) {
- sec_dbg("[ecc=%s, category:[%d]]", modem_info->sim_ecc_list.list[i].number, modem_info->sim_ecc_list.list[i].category);
- if (!g_strcmp0(pNumber, modem_info->sim_ecc_list.list[i].number)) {
- *ecc_category = modem_info->sim_ecc_list.list[i].category;
- dbg("uecc matched!!");
- *is_sim_ecc = TRUE;
- return 0;
- }
- }
+ }
+ }
+ break;
+ case CM_CARD_TYPE_USIM:
+ {
+ dbg("SimCardType=SIM_CARD_TYPE_USIM");
+
+ if (modem_info->sim_ecc_list.ecc_count > 0) {
+ for (i = 0; i < modem_info->sim_ecc_list.ecc_count; i++) {
+ sec_dbg("[ecc=%s, category:[%d]]", modem_info->sim_ecc_list.list[i].number, modem_info->sim_ecc_list.list[i].category);
+ if (!g_strcmp0(pNumber, modem_info->sim_ecc_list.list[i].number)) {
+ *ecc_category = modem_info->sim_ecc_list.list[i].category;
+ dbg("uecc matched!!");
+ *is_sim_ecc = TRUE;
+ return 0;
}
}
- break;
- default:
- dbg("type : %d", simcard_type);
- break;
+ }
+ }
+ break;
+ default:
+ dbg("type : %d", simcard_type);
+ break;
}
return -1;
switch (ss_type) {
/* Releases all held calls or Set UDUB(User Determined User Busy) for a waiting call */
case CM_INCALL_SS_0_E:
- {
- /* if an incoming call is activated, reject the incoming all */
- if (incom_call) {
- _callmgr_telephony_reject_call(telephony_handle);
- return 0;
- } else if (held_call) {
- _callmgr_telephony_end_call(telephony_handle, held_call->call_id, CM_TEL_CALL_RELEASE_TYPE_ALL_HOLD_CALLS);
- } else {
- err("No hold calls");
- return -1;
- }
+ {
+ /* if an incoming call is activated, reject the incoming all */
+ if (incom_call) {
+ _callmgr_telephony_reject_call(telephony_handle);
+ return 0;
+ } else if (held_call) {
+ _callmgr_telephony_end_call(telephony_handle, held_call->call_id, CM_TEL_CALL_RELEASE_TYPE_ALL_HOLD_CALLS);
+ } else {
+ err("No hold calls");
+ return -1;
}
+ }
break;
case CM_INCALL_SS_1_E:
- {
- if (incom_call) {
- /* Accept incoming call */
- _callmgr_telephony_answer_call(telephony_handle, CM_TEL_CALL_ANSWER_TYPE_RELEASE_ACTIVE_AND_ACCEPT);
- return 0;
- } else if (dial_call || alert_call) {
- if (dial_call) {
- selected_call_id = dial_call->call_id;
- } else {
- selected_call_id = alert_call->call_id;
- }
- _callmgr_telephony_end_call(telephony_handle, selected_call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE);
-
- if (held_call) {
- __callmgr_telephony_set_retrieve_flag(held_call, TRUE);
- }
- } else if (active_call) {
- _callmgr_telephony_end_call(telephony_handle, active_call->call_id, CM_TEL_CALL_RELEASE_TYPE_ALL_ACTIVE_CALLS);
- if (held_call) {
- __callmgr_telephony_set_retrieve_flag(held_call, TRUE);
- }
- } else if (held_call) {
- if (_callmgr_telephony_active_call(telephony_handle) < 0) {
- err("retrieve err");
- return -1;
- }
- return 0;
+ {
+ if (incom_call) {
+ /* Accept incoming call */
+ _callmgr_telephony_answer_call(telephony_handle, CM_TEL_CALL_ANSWER_TYPE_RELEASE_ACTIVE_AND_ACCEPT);
+ return 0;
+ } else if (dial_call || alert_call) {
+ if (dial_call) {
+ selected_call_id = dial_call->call_id;
} else {
- err("No valid calls");
+ selected_call_id = alert_call->call_id;
+ }
+ _callmgr_telephony_end_call(telephony_handle, selected_call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE);
+
+ if (held_call) {
+ __callmgr_telephony_set_retrieve_flag(held_call, TRUE);
+ }
+ } else if (active_call) {
+ _callmgr_telephony_end_call(telephony_handle, active_call->call_id, CM_TEL_CALL_RELEASE_TYPE_ALL_ACTIVE_CALLS);
+ if (held_call) {
+ __callmgr_telephony_set_retrieve_flag(held_call, TRUE);
+ }
+ } else if (held_call) {
+ if (_callmgr_telephony_active_call(telephony_handle) < 0) {
+ err("retrieve err");
return -1;
}
+ return 0;
+ } else {
+ err("No valid calls");
+ return -1;
}
+ }
break;
case CM_INCALL_SS_1X_E:
- {
- if (incom_call) {
- err("No incom calls");
+ {
+ if (incom_call) {
+ err("No incom calls");
+ return -1;
+ } else if (active_call) {
+ if (_callmgr_telephony_end_call(telephony_handle, selected_call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE) < 0) {
+ err("end call err");
return -1;
- } else if (active_call) {
- if (_callmgr_telephony_end_call(telephony_handle, selected_call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE) < 0) {
- err("end call err");
- return -1;
- } else {
- return 0;
- }
} else {
- err("No valid calls");
- return -1;
+ return 0;
}
+ } else {
+ err("No valid calls");
+ return -1;
}
+ }
break;
case CM_INCALL_SS_2_E:
- {
- if (incom_call) {
- if (active_call && held_call) {
- err("No valid request");
- return -1;
- } else {
- _callmgr_telephony_answer_call(telephony_handle, CM_TEL_CALL_ANSWER_TYPE_HOLD_ACTIVE_AND_ACCEPT);
- }
- } else if (alert_call || dial_call) {
+ {
+ if (incom_call) {
+ if (active_call && held_call) {
err("No valid request");
return -1;
- } else if (active_call && held_call) {
- _callmgr_telephony_swap_call(telephony_handle);
- } else if (active_call) {
- _callmgr_telephony_hold_call(telephony_handle);
- } else if (held_call) {
- _callmgr_telephony_active_call(telephony_handle);
} else {
- err("No valid request");
- return -1;
+ _callmgr_telephony_answer_call(telephony_handle, CM_TEL_CALL_ANSWER_TYPE_HOLD_ACTIVE_AND_ACCEPT);
}
+ } else if (alert_call || dial_call) {
+ err("No valid request");
+ return -1;
+ } else if (active_call && held_call) {
+ _callmgr_telephony_swap_call(telephony_handle);
+ } else if (active_call) {
+ _callmgr_telephony_hold_call(telephony_handle);
+ } else if (held_call) {
+ _callmgr_telephony_active_call(telephony_handle);
+ } else {
+ err("No valid request");
+ return -1;
}
+ }
break;
case CM_INCALL_SS_2X_E:
- {
- if (incom_call || dial_call || alert_call) {
- info("No valid calls");
- return -1;
- } else if ((active_call != NULL) && (held_call == NULL)) {
- if (active_call->is_conference) {
- if (_callmgr_telephony_split_call(telephony_handle, selected_call_id) < 0) {
- err("_callmgr_telephony_split_call() failed");
- return -1;
- }
+ {
+ if (incom_call || dial_call || alert_call) {
+ info("No valid calls");
+ return -1;
+ } else if ((active_call != NULL) && (held_call == NULL)) {
+ if (active_call->is_conference) {
+ if (_callmgr_telephony_split_call(telephony_handle, selected_call_id) < 0) {
+ err("_callmgr_telephony_split_call() failed");
+ return -1;
}
- } else {
- info("No valid calls");
- return -1;
}
+ } else {
+ info("No valid calls");
+ return -1;
}
+ }
break;
case CM_INCALL_SS_3_E:
- {
- if (incom_call) {
- info("No valid calls");
- return -1;
- }
+ {
+ if (incom_call) {
+ info("No valid calls");
+ return -1;
+ }
- if (active_call || held_call) {
- _callmgr_telephony_join_call(telephony_handle);
- } else {
- info("No valid calls");
- return -1;
- }
+ if (active_call || held_call) {
+ _callmgr_telephony_join_call(telephony_handle);
+ } else {
+ info("No valid calls");
+ return -1;
}
+ }
break;
case CM_INCALL_SS_4_E:
- {
- cm_telephony_call_data_t *call_to_transfer = NULL;
+ {
+ cm_telephony_call_data_t *call_to_transfer = NULL;
- if (_callmgr_telephony_get_call_count(telephony_handle, &call_count) < 0) {
- err("get count err");
- return -1;
- }
+ if (_callmgr_telephony_get_call_count(telephony_handle, &call_count) < 0) {
+ err("get count err");
+ return -1;
+ }
- if (call_count != 2) {
- warn("Invalid call count");
- return -1;
- }
+ if (call_count != 2) {
+ warn("Invalid call count");
+ return -1;
+ }
- if (held_call) {
- if (alert_call) {
- call_to_transfer = alert_call;
- } else if (active_call) {
- call_to_transfer = active_call;
- }
- } else {
- warn("no call in held state");
- return -1;
+ if (held_call) {
+ if (alert_call) {
+ call_to_transfer = alert_call;
+ } else if (active_call) {
+ call_to_transfer = active_call;
}
+ } else {
+ warn("no call in held state");
+ return -1;
+ }
- if (call_to_transfer) {
- if (_callmgr_telephony_transfer_call(telephony_handle, call_to_transfer) < 0) {
- info("Transfer err");
- return -1;
- } else {
- return 0;
- }
- } else {
- warn("Invalid call state");
+ if (call_to_transfer) {
+ if (_callmgr_telephony_transfer_call(telephony_handle, call_to_transfer) < 0) {
+ info("Transfer err");
return -1;
+ } else {
+ return 0;
}
+ } else {
+ warn("Invalid call state");
+ return -1;
}
+ }
break;
default:
info("Invalid type");
/* 08 is emergency number */
*o_is_ss = FALSE;
return 0;
- } else if(number[1] == '0' && call_count == 0) {
+ } else if (number[1] == '0' && call_count == 0) {
warn("If NO CALL then dial call for 00");
*o_is_ss = FALSE;
return 0;
*o_is_ss = TRUE;
return 0;
}
- }
+ }
if ((number[0] == '1') && (IS_DIGIT(number[1]))) {
- if ((number[1] == '0')&&(call_count >0)) {
+ if ((number[1] == '0') && (call_count > 0)) {
/* 10 is ussd */
info("10 is USSD string when active call exist");
*o_is_ss = TRUE;
return 0;
- }else {
+ } else {
*o_is_ss = FALSE;
return 0;
}
- }
- else if ((ISUSSDDIGIT(number[0]) && IS_DIGIT(number[1]))) {
+ } else if ((ISUSSDDIGIT(number[0]) && IS_DIGIT(number[1]))) {
unsigned long mcc = 0;
unsigned long mnc = 0;
__callmgr_telephony_get_network_mcc_mnc(telephony_handle, slot_id, &mcc, &mnc);
*end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_NOT_ALLOWED;
} else {
switch (cause) {
- case TAPI_CC_CAUSE_NORMAL_UNSPECIFIED:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_DISCONNECTED;
- break;
+ case TAPI_CC_CAUSE_NORMAL_UNSPECIFIED:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_DISCONNECTED;
+ break;
- case TAPI_CC_CAUSE_FACILITY_REJECTED:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_NOT_ALLOWED;
- break;
+ case TAPI_CC_CAUSE_FACILITY_REJECTED:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_NOT_ALLOWED;
+ break;
- case TAPI_CC_CAUSE_QUALITY_OF_SERVICE_UNAVAILABLE:
- case TAPI_CC_CAUSE_ACCESS_INFORMATION_DISCARDED:
- case TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_AUTHORISED:
- case TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE:
- case TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_AVAILABLE:
- case TAPI_CC_CAUSE_BEARER_SERVICE_NOT_IMPLEMENTED:
- case TAPI_CC_CAUSE_PROTOCOL_ERROR_UNSPECIFIED:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_ENDED;
- break;
+ case TAPI_CC_CAUSE_QUALITY_OF_SERVICE_UNAVAILABLE:
+ case TAPI_CC_CAUSE_ACCESS_INFORMATION_DISCARDED:
+ case TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_AUTHORISED:
+ case TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE:
+ case TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_AVAILABLE:
+ case TAPI_CC_CAUSE_BEARER_SERVICE_NOT_IMPLEMENTED:
+ case TAPI_CC_CAUSE_PROTOCOL_ERROR_UNSPECIFIED:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_ENDED;
+ break;
- case TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_SUBSCRIBED:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_SERVICE_NOT_ALLOWED;
- break;
+ case TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_SUBSCRIBED:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_SERVICE_NOT_ALLOWED;
+ break;
- case TAPI_CC_CAUSE_OPERATOR_DETERMINED_BARRING:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_BARRED;
- break;
- case TAPI_REJECT_CAUSE_MM_REJ_NO_SERVICE:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_NO_SERVICE;
- break;
+ case TAPI_CC_CAUSE_OPERATOR_DETERMINED_BARRING:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_BARRED;
+ break;
+ case TAPI_REJECT_CAUSE_MM_REJ_NO_SERVICE:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_NO_SERVICE;
+ break;
- case TAPI_REJECT_CAUSE_CONGESTTION:
- case TAPI_REJECT_CAUSE_CNM_REJ_NO_RESOURCES:
- case TAPI_CC_CAUSE_SWITCHING_EQUIPMENT_CONGESTION: /* Match as NW_BUSY*/
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_NW_BUSY;
- break;
+ case TAPI_REJECT_CAUSE_CONGESTTION:
+ case TAPI_REJECT_CAUSE_CNM_REJ_NO_RESOURCES:
+ case TAPI_CC_CAUSE_SWITCHING_EQUIPMENT_CONGESTION: /* Match as NW_BUSY*/
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_NW_BUSY;
+ break;
- case TAPI_REJECT_CAUSE_NETWORK_FAILURE:
- case TAPI_REJECT_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_NW_FAILED;
- break;
+ case TAPI_REJECT_CAUSE_NETWORK_FAILURE:
+ case TAPI_REJECT_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_NW_FAILED;
+ break;
- case TAPI_REJECT_CAUSE_IMEI_NOT_ACCEPTED:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_NW_FAILED; /*Display Network unavailable*/
- break;
+ case TAPI_REJECT_CAUSE_IMEI_NOT_ACCEPTED:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_NW_FAILED; /*Display Network unavailable*/
+ break;
- case TAPI_CC_CAUSE_NO_ROUTE_TO_DEST:
- case TAPI_CC_CAUSE_TEMPORARY_FAILURE:
- case TAPI_CC_CAUSE_NETWORK_OUT_OF_ORDER:
- case TAPI_CC_CAUSE_REQUESTED_CIRCUIT_CHANNEL_NOT_AVAILABLE:
- case TAPI_CC_CAUSE_NO_CIRCUIT_CHANNEL_AVAILABLE:
- case TAPI_CC_CAUSE_DESTINATION_OUT_OF_ORDER:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_SERVICE_TEMP_UNAVAILABLE;
- break;
- case TAPI_CC_CAUSE_NO_USER_RESPONDING:
- case TAPI_CC_CAUSE_USER_ALERTING_NO_ANSWER:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_USER_DOESNOT_RESPOND;
- break;
+ case TAPI_CC_CAUSE_NO_ROUTE_TO_DEST:
+ case TAPI_CC_CAUSE_TEMPORARY_FAILURE:
+ case TAPI_CC_CAUSE_NETWORK_OUT_OF_ORDER:
+ case TAPI_CC_CAUSE_REQUESTED_CIRCUIT_CHANNEL_NOT_AVAILABLE:
+ case TAPI_CC_CAUSE_NO_CIRCUIT_CHANNEL_AVAILABLE:
+ case TAPI_CC_CAUSE_DESTINATION_OUT_OF_ORDER:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_SERVICE_TEMP_UNAVAILABLE;
+ break;
+ case TAPI_CC_CAUSE_NO_USER_RESPONDING:
+ case TAPI_CC_CAUSE_USER_ALERTING_NO_ANSWER:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_USER_DOESNOT_RESPOND;
+ break;
- case TAPI_CC_CAUSE_ACM_GEQ_ACMMAX:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_NO_CREDIT;
- break;
+ case TAPI_CC_CAUSE_ACM_GEQ_ACMMAX:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_NO_CREDIT;
+ break;
- case TAPI_CC_CAUSE_CALL_REJECTED:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_USER_UNAVAILABLE;
- break;
+ case TAPI_CC_CAUSE_CALL_REJECTED:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_USER_UNAVAILABLE;
+ break;
- case TAPI_CC_CAUSE_USER_BUSY:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_USER_BUSY;
- break;
+ case TAPI_CC_CAUSE_USER_BUSY:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_USER_BUSY;
+ break;
- case TAPI_CC_CAUSE_USER_NOT_MEMBER_OF_CUG:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_WRONG_GROUP;
- break;
+ case TAPI_CC_CAUSE_USER_NOT_MEMBER_OF_CUG:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_WRONG_GROUP;
+ break;
- case TAPI_CC_CAUSE_INVALID_NUMBER_FORMAT:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_INVALID_NUMBER_FORMAT;
- break;
+ case TAPI_CC_CAUSE_INVALID_NUMBER_FORMAT:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_INVALID_NUMBER_FORMAT;
+ break;
- case TAPI_CC_CAUSE_UNASSIGNED_NUMBER:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_UNASSIGNED_NUMBER;
- break;
+ case TAPI_CC_CAUSE_UNASSIGNED_NUMBER:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_UNASSIGNED_NUMBER;
+ break;
- case TAPI_CC_CAUSE_NUMBER_CHANGED:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_NUMBER_CHANGED;
- break;
+ case TAPI_CC_CAUSE_NUMBER_CHANGED:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_NUMBER_CHANGED;
+ break;
- case TAPI_CALL_END_NO_CAUSE:
- default:
- *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_ENDED;
+ case TAPI_CALL_END_NO_CAUSE:
+ default:
+ *end_cause_type = CM_TELEPHONY_ENDCAUSE_CALL_ENDED;
- info("Call Ended or Default Cause Value: %d", *end_cause_type);
+ info("Call Ended or Default Cause Value: %d", *end_cause_type);
break;
}
}
static gboolean __callmgr_vr_state_changed_cb_real(void *user_data)
{
callmgr_vr_cb_info_t *info = (callmgr_vr_cb_info_t *)user_data;
- callmgr_vr_handle_h vr_handle = (callmgr_vr_handle_h )info->user_data;
+ callmgr_vr_handle_h vr_handle = (callmgr_vr_handle_h)info->user_data;
callmgr_vr_status_extra_type_e extra_data;
/*recorder_state_e previous, recorder_state_e current, bool by_policy,*/
static gboolean __callmgr_vr_limit_reached_cb_real(void *user_data)
{
callmgr_vr_cb_info_t *info = (callmgr_vr_cb_info_t *)user_data;
- callmgr_vr_handle_h vr_handle = (callmgr_vr_handle_h )info->user_data;
+ callmgr_vr_handle_h vr_handle = (callmgr_vr_handle_h)info->user_data;
callmgr_vr_status_extra_type_e extra_data = CALLMGR_VR_STATUS_EXTRA_STOP_TYPE_BY_NORMAL;
int result = 0;
CM_RETURN_IF_FAIL(vr_handle);
callmgr_vr_cb_info_t *info = (callmgr_vr_cb_info_t *)calloc(1, sizeof(callmgr_vr_cb_info_t));
- if(NULL == info) {
+ if (NULL == info) {
err("memory allocation failed...");
return;
}
CM_RETURN_IF_FAIL(vr_handle);
callmgr_vr_cb_info_t *info = (callmgr_vr_cb_info_t *)calloc(1, sizeof(callmgr_vr_cb_info_t));
- if(NULL == info) {
+ if (NULL == info) {
err("memory allocation failed...");
return;
}
CM_RETURN_IF_FAIL(vr_handle);
callmgr_vr_cb_info_t *info = (callmgr_vr_cb_info_t *)calloc(1, sizeof(callmgr_vr_cb_info_t));
- if(NULL == info) {
+ if (NULL == info) {
err("memory allocation failed...");
return;
}
dbg("filter condition type : %d", cond_type);
const char *condition = NULL;
switch (cond_type) {
- case CM_VR_FILTER_ALL:
- condition = "MEDIA_STORAGE_TYPE=122";
- break;
- case CM_VR_FILTER_PLAYED:
- condition = "MEDIA_STORAGE_TYPE=122 AND MEDIA_PLAYED_COUNT>0";
- break;
- case CM_VR_FILTER_UNPLAYED:
- condition = "MEDIA_STORAGE_TYPE=122 AND MEDIA_PLAYED_COUNT=0";
- break;
- default:
- err("Filter type is error");
- goto error;
- break;
+ case CM_VR_FILTER_ALL:
+ condition = "MEDIA_STORAGE_TYPE=122";
+ break;
+ case CM_VR_FILTER_PLAYED:
+ condition = "MEDIA_STORAGE_TYPE=122 AND MEDIA_PLAYED_COUNT>0";
+ break;
+ case CM_VR_FILTER_UNPLAYED:
+ condition = "MEDIA_STORAGE_TYPE=122 AND MEDIA_PLAYED_COUNT=0";
+ break;
+ default:
+ err("Filter type is error");
+ goto error;
+ break;
}
ret = media_filter_create(&filter);
{
CM_RETURN_VAL_IF_FAIL(vr_handle, -1);
int ret = -1;
- callmgr_vr_status_extra_type_e stop_type= CALLMGR_VR_STATUS_EXTRA_STOP_TYPE_MAX;
+ callmgr_vr_status_extra_type_e stop_type = CALLMGR_VR_STATUS_EXTRA_STOP_TYPE_MAX;
ret = __callmgr_vr_commit(vr_handle);
if (ret == 0) {
- if (vr_handle->elapsed_time > CM_VR_RECORD_TIME_MIN ) {
+ if (vr_handle->elapsed_time > CM_VR_RECORD_TIME_MIN) {
dbg("record duration %ld millisecond", vr_handle->elapsed_time);
- ret =__callmgr_vr_create_filename(vr_handle);
+ ret = __callmgr_vr_create_filename(vr_handle);
stop_type = CALLMGR_VR_STATUS_EXTRA_STOP_TYPE_BY_NORMAL;
} else {
warn("The recording time is too short [%ld millisecond]! Do not save record file", vr_handle->elapsed_time);
return 0;
}
-static int __callmgr_core_convert_tel_call_type(cm_telephony_call_type_e tel_call_type, callmgr_call_type_e *cm_call_type) {
+static int __callmgr_core_convert_tel_call_type(cm_telephony_call_type_e tel_call_type, callmgr_call_type_e *cm_call_type)
+{
dbg(">>");
- if((tel_call_type == CM_TEL_CALL_TYPE_CS_VOICE) || (tel_call_type == CM_TEL_CALL_TYPE_PS_VOICE) || (tel_call_type == CM_TEL_CALL_TYPE_E911)) {
+ if ((tel_call_type == CM_TEL_CALL_TYPE_CS_VOICE) || (tel_call_type == CM_TEL_CALL_TYPE_PS_VOICE) || (tel_call_type == CM_TEL_CALL_TYPE_E911)) {
*cm_call_type = CALL_TYPE_VOICE_E;
- }
- else if ((tel_call_type == CM_TEL_CALL_TYPE_CS_VIDEO) || (tel_call_type == CM_TEL_CALL_TYPE_PS_VIDEO)) {
+ } else if ((tel_call_type == CM_TEL_CALL_TYPE_CS_VIDEO) || (tel_call_type == CM_TEL_CALL_TYPE_PS_VIDEO)) {
*cm_call_type = CALL_TYPE_VIDEO_E;
- }
- else {
+ } else {
*cm_call_type = CALL_TYPE_INVALID_E;
}
return 0;
/* Set Telephony route */
switch (active_device) {
- case CALLMGR_AUDIO_DEVICE_BT_E:
- /* ToDo: get BT NREC status */
- _callmgr_bt_is_nrec_enabled(core_data->bt_handle, &is_nrec);
- if (is_nrec) {
- tel_path = CM_TAPI_SOUND_PATH_BT_NSEC_OFF;
- }
- else {
- tel_path = CM_TAPI_SOUND_PATH_BLUETOOTH;
- }
- break;
- case CALLMGR_AUDIO_DEVICE_SPEAKER_E:
- tel_path = CM_TAPI_SOUND_PATH_SPK_PHONE;
- break;
- case CALLMGR_AUDIO_DEVICE_EARJACK_E:
- tel_path = CM_TAPI_SOUND_PATH_HEADSET;
- break;
- case CALLMGR_AUDIO_DEVICE_RECEIVER_E:
- default:
- tel_path = CM_TAPI_SOUND_PATH_HANDSET;
- break;
+ case CALLMGR_AUDIO_DEVICE_BT_E:
+ /* ToDo: get BT NREC status */
+ _callmgr_bt_is_nrec_enabled(core_data->bt_handle, &is_nrec);
+ if (is_nrec) {
+ tel_path = CM_TAPI_SOUND_PATH_BT_NSEC_OFF;
+ } else {
+ tel_path = CM_TAPI_SOUND_PATH_BLUETOOTH;
+ }
+ break;
+ case CALLMGR_AUDIO_DEVICE_SPEAKER_E:
+ tel_path = CM_TAPI_SOUND_PATH_SPK_PHONE;
+ break;
+ case CALLMGR_AUDIO_DEVICE_EARJACK_E:
+ tel_path = CM_TAPI_SOUND_PATH_HEADSET;
+ break;
+ case CALLMGR_AUDIO_DEVICE_RECEIVER_E:
+ default:
+ tel_path = CM_TAPI_SOUND_PATH_HANDSET;
+ break;
}
_callmgr_audio_get_extra_vol(core_data->audio_handle, &is_extra_vol);
call_data->start_time = start_time;
_callmgr_telephony_get_call_name_mode(tel_call_data, &name_mode);
- switch(name_mode) {
- case CM_TEL_NAME_MODE_UNKNOWN:
- call_data->name_mode = CALL_NAME_MODE_UNKNOWN;
- break;
- case CM_TEL_NAME_MODE_PRIVATE:
- call_data->name_mode = CALL_NAME_MODE_PRIVATE;
- break;
- case CM_TEL_NAME_MODE_PAYPHONE:
- call_data->name_mode = CALL_NAME_MODE_PAYPHONE;
- break;
- default:
- call_data->name_mode = CALL_NAME_MODE_NONE;
- break;
+ switch (name_mode) {
+ case CM_TEL_NAME_MODE_UNKNOWN:
+ call_data->name_mode = CALL_NAME_MODE_UNKNOWN;
+ break;
+ case CM_TEL_NAME_MODE_PRIVATE:
+ call_data->name_mode = CALL_NAME_MODE_PRIVATE;
+ break;
+ case CM_TEL_NAME_MODE_PAYPHONE:
+ call_data->name_mode = CALL_NAME_MODE_PAYPHONE;
+ break;
+ default:
+ call_data->name_mode = CALL_NAME_MODE_NONE;
+ break;
}
_callmgr_telephony_get_active_sim_slot(core_data->telephony_handle, &active_sim_slot);
/* Incoming call */
_callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_INCOMING, &incom_call_data);
- if(incom_call_data) {
- if(NULL == core_data->incom) {
- if(__callmgr_core_create_call_data(&core_data->incom) < 0) {
+ if (incom_call_data) {
+ if (NULL == core_data->incom) {
+ if (__callmgr_core_create_call_data(&core_data->incom) < 0) {
err("__callmgr_core_create_call_data failed");
return;
}
/* Active call */
_callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_DIALING, &active_dial_call_data);
- if(active_dial_call_data == NULL) {
+ if (active_dial_call_data == NULL) {
_callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_ALERT, &active_dial_call_data);
- if(active_dial_call_data == NULL) {
+ if (active_dial_call_data == NULL) {
_callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_ACTIVE, &active_dial_call_data);
- if(active_dial_call_data == NULL) {
+ if (active_dial_call_data == NULL) {
if (core_data->active_dial) {
__callmgr_core_delete_call_data(core_data->active_dial);
core_data->active_dial = NULL;
}
if (active_dial_call_data) {
- if(core_data->active_dial == NULL) {
+ if (core_data->active_dial == NULL) {
if (__callmgr_core_create_call_data(&core_data->active_dial) < 0) {
err("__callmgr_core_create_call_data failed");
return;
/* Held call */
_callmgr_telephony_get_call_by_state(telephony_handle, CM_TEL_CALL_STATE_HELD, &held_call_data);
- if(held_call_data) {
- if(NULL == core_data->held) {
- if(__callmgr_core_create_call_data(&core_data->held) < 0) {
+ if (held_call_data) {
+ if (NULL == core_data->held) {
+ if (__callmgr_core_create_call_data(&core_data->held) < 0) {
err("__callmgr_core_create_call_data failed");
return;
}
}
/*Send DTMF */
- if ((dtmf_number[0]== 'p' ) || (dtmf_number[0] == 'P') || (dtmf_number[0] == ',')) {
+ if ((dtmf_number[0] == 'p') || (dtmf_number[0] == 'P') || (dtmf_number[0] == ',')) {
info("pause");
_callmgr_dbus_send_dtmf_indi(core_data, CALL_DTMF_INDI_IDLE_E, NULL);
if (strlen(dtmf_number) > 1) {
_callmgr_telephony_set_dtmf_number(call, &dtmf_number[1]);
core_data->dtmf_pause_timer = g_timeout_add(3000, __callmgr_core_dtmf_pause_timer_cb, core_data);
- }
- else {
+ } else {
_callmgr_telephony_set_dtmf_number(call, NULL);
- }
- } else if ((dtmf_number[0] == 'w') || (dtmf_number[0] == 'W') || (dtmf_number[0] == ';')) {
+ } } else if ((dtmf_number[0] == 'w') || (dtmf_number[0] == 'W') || (dtmf_number[0] == ';')) {
info("wait");
_callmgr_dbus_send_dtmf_indi(core_data, CALL_DTMF_INDI_IDLE_E, NULL);
if (strlen(dtmf_number) > 1) {
_callmgr_telephony_set_dtmf_number(call, &dtmf_number[1]);
_callmgr_dbus_send_dtmf_indi(core_data, CALL_DTMF_INDI_WAIT_E, &dtmf_number[1]);
- }
- else {
+ } else {
_callmgr_telephony_set_dtmf_number(call, NULL);
}
} else {
if (strlen(dtmf_number) > 1) {
_callmgr_telephony_set_dtmf_number(call, &dtmf_number[1]);
- }
- else {
+ } else {
_callmgr_telephony_set_dtmf_number(call, NULL);
_callmgr_dbus_send_dtmf_indi(core_data, CALL_DTMF_INDI_IDLE_E, NULL);
}
core_data->auto_answer_timer = 0;
}
- if(core_data->active_dial == NULL && core_data->held == NULL){
- ret = _callmgr_core_process_answer_call(core_data,0);
+ if (core_data->active_dial == NULL && core_data->held == NULL) {
+ ret = _callmgr_core_process_answer_call(core_data, 0);
if (ret == 0) {
warn("_callmgr_core_process_answer_call() is successfully done");
core_data->is_auto_answered = TRUE;
} else if (TRUE == is_test_answer_mode_enabled) {
warn("Request testmode auto answer");
core_data->auto_answer_timer = g_timeout_add_seconds(3, __callmgr_core_auto_answer_timer_cb, core_data);
- } else if (TRUE == is_answer_mode_enabled){
+ } else if (TRUE == is_answer_mode_enabled) {
_callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_BT_E, &is_bt_connected);
_callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_EARJACK_E, &is_earjack_available);
return;
}
- core_data->auto_answer_timer = g_timeout_add_seconds(auto_answer_time_in_sec, __callmgr_core_auto_answer_timer_cb,core_data);
- }
- else{
+ core_data->auto_answer_timer = g_timeout_add_seconds(auto_answer_time_in_sec, __callmgr_core_auto_answer_timer_cb, core_data);
+ } else{
warn("Without earjack or bt, skip auto answer ");
}
if (cm_call_type == CALL_TYPE_VOICE_E) {
sound_mode = CALLMGR_AUDIO_SESSION_VOICE_E;
- }
- else if (cm_call_type == CALL_TYPE_VIDEO_E) {
+ } else if (cm_call_type == CALL_TYPE_VIDEO_E) {
sound_mode = CALLMGR_AUDIO_SESSION_VIDEO_E;
- }
- else {
+ } else {
err("Invalid call type[%d].", cm_call_type);
sound_mode = CALLMGR_AUDIO_SESSION_VOICE_E;
}
_callmgr_ct_get_call_name(core_data->active_dial->call_id, &call_name);
ret = _callmgr_vr_start_record(core_data->vr_handle, core_data->active_dial->call_number, call_name, TRUE);
g_free(call_name);
- if(ret < 0) {
+ if (ret < 0) {
err("_callmgr_vr_start_record() failed");
_callmgr_core_process_end_call(core_data, 0, CM_TEL_CALL_RELEASE_TYPE_ALL_ACTIVE_CALLS);
}
case CM_TELEPHONY_ENDCAUSE_USER_BUSY:
case CM_TELEPHONY_ENDCAUSE_USER_UNAVAILABLE:
case CM_TELEPHONY_ENDCAUSE_NO_ANSWER:
- {
- *signal_type = CALL_SIGNAL_USER_BUSY_TONE_E;
- }
+ {
+ *signal_type = CALL_SIGNAL_USER_BUSY_TONE_E;
+ }
break;
case CM_TELEPHONY_ENDCAUSE_INVALID_NUMBER_FORMAT:
case CM_TELEPHONY_ENDCAUSE_NUMBER_CHANGED:
case CM_TELEPHONY_ENDCAUSE_UNASSIGNED_NUMBER:
- {
- *signal_type = CALL_SIGNAL_WRONG_NUMBER_TONE_E;
- }
+ {
+ *signal_type = CALL_SIGNAL_WRONG_NUMBER_TONE_E;
+ }
break;
case CM_TELEPHONY_ENDCAUSE_SERVICE_TEMP_UNAVAILABLE:
- {
- *signal_type = CALL_SIGNAL_CALL_FAIL_TONE_E;
- }
+ {
+ *signal_type = CALL_SIGNAL_CALL_FAIL_TONE_E;
+ }
break;
case CM_TELEPHONY_ENDCAUSE_NW_BUSY:
- {
- *signal_type = CALL_SIGNAL_NW_CONGESTION_TONE_E;
- }
+ {
+ *signal_type = CALL_SIGNAL_NW_CONGESTION_TONE_E;
+ }
break;
default:
break;
_callmgr_telephony_get_active_sim_slot(core_data->telephony_handle, &active_sim_slot);
switch (event_type) {
- case CM_TELEPHONY_EVENT_IDLE:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
- callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
- cm_telephony_call_data_t *call_data_out = NULL;
- cm_telephony_call_direction_e call_direction;
- cm_telephony_call_state_e call_state = CM_TEL_CALL_STATE_MAX;
- cm_telephony_call_type_e call_type = CM_TEL_CALL_TYPE_INVALID;
- cm_ct_plog_reject_type_e reject_type = 0;
- cm_ct_plog_data_t *log_data = NULL;
- int call_duration = 0;
- long start_time = 0;
- gboolean is_ecc = FALSE;
- gboolean b_play_effect_tone = TRUE;
- int call_cnt = 0;
- callmgr_call_data_t *end_call_data = NULL;
-
- __callmgr_core_cancel_auto_answer(core_data);
- __callmgr_core_stop_incom_noti(core_data);
- _callmgr_ringer_stop_local_ringback_tone(core_data->ringer_handle);
-
- info("Call[%d] is ended", call_id);
- _callmgr_telephony_get_call_by_call_id(core_data->telephony_handle, call_id, &call_data_out);
- CM_RETURN_IF_FAIL(call_data_out);
-
- _callmgr_telephony_get_call_start_time(call_data_out, &start_time);
- _callmgr_util_get_time_diff(start_time, &call_duration);
- _callmgr_telephony_get_call_direction(call_data_out, &call_direction);
- _callmgr_telephony_get_call_state(call_data_out, &call_state);
- _callmgr_telephony_get_call_type(call_data_out, &call_type);
- __callmgr_core_convert_tel_call_type(call_type, &cm_call_type);
- _callmgr_ct_get_log_reject_type(call_id, &reject_type);
- _callmgr_telephony_get_call_end_cause(call_data_out, &end_cause);
- _callmgr_telephony_get_is_ecc(call_data_out, &is_ecc);
-
- log_data = (cm_ct_plog_data_t*)calloc(1, sizeof(cm_ct_plog_data_t));
- CM_RETURN_IF_FAIL(log_data);
- log_data->call_id = call_id;
- log_data->sim_slot = active_sim_slot;
- log_data->call_duration = call_duration;
- log_data->presentation = CM_CT_PLOG_PRESENT_DEFAULT;
+ case CM_TELEPHONY_EVENT_IDLE:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
+ cm_telephony_call_data_t *call_data_out = NULL;
+ cm_telephony_call_direction_e call_direction;
+ cm_telephony_call_state_e call_state = CM_TEL_CALL_STATE_MAX;
+ cm_telephony_call_type_e call_type = CM_TEL_CALL_TYPE_INVALID;
+ cm_ct_plog_reject_type_e reject_type = 0;
+ cm_ct_plog_data_t *log_data = NULL;
+ int call_duration = 0;
+ long start_time = 0;
+ gboolean is_ecc = FALSE;
+ gboolean b_play_effect_tone = TRUE;
+ int call_cnt = 0;
+ callmgr_call_data_t *end_call_data = NULL;
+
+ __callmgr_core_cancel_auto_answer(core_data);
+ __callmgr_core_stop_incom_noti(core_data);
+ _callmgr_ringer_stop_local_ringback_tone(core_data->ringer_handle);
+
+ info("Call[%d] is ended", call_id);
+ _callmgr_telephony_get_call_by_call_id(core_data->telephony_handle, call_id, &call_data_out);
+ CM_RETURN_IF_FAIL(call_data_out);
+
+ _callmgr_telephony_get_call_start_time(call_data_out, &start_time);
+ _callmgr_util_get_time_diff(start_time, &call_duration);
+ _callmgr_telephony_get_call_direction(call_data_out, &call_direction);
+ _callmgr_telephony_get_call_state(call_data_out, &call_state);
+ _callmgr_telephony_get_call_type(call_data_out, &call_type);
+ __callmgr_core_convert_tel_call_type(call_type, &cm_call_type);
+ _callmgr_ct_get_log_reject_type(call_id, &reject_type);
+ _callmgr_telephony_get_call_end_cause(call_data_out, &end_cause);
+ _callmgr_telephony_get_is_ecc(call_data_out, &is_ecc);
+
+ log_data = (cm_ct_plog_data_t*)calloc(1, sizeof(cm_ct_plog_data_t));
+ CM_RETURN_IF_FAIL(log_data);
+ log_data->call_id = call_id;
+ log_data->sim_slot = active_sim_slot;
+ log_data->call_duration = call_duration;
+ log_data->presentation = CM_CT_PLOG_PRESENT_DEFAULT;
+
+ if (core_data->incom && core_data->incom->call_id == call_id) {
+ end_call_data = core_data->incom;
+ } else if (core_data->active_dial && core_data->active_dial->call_id == call_id) {
+ end_call_data = core_data->active_dial;
+ } else if (core_data->held && core_data->held->call_id == call_id) {
+ end_call_data = core_data->held;
+ }
- if (core_data->incom && core_data->incom->call_id == call_id) {
- end_call_data = core_data->incom;
- } else if (core_data->active_dial && core_data->active_dial->call_id == call_id) {
- end_call_data = core_data->active_dial;
- } else if (core_data->held && core_data->held->call_id == call_id) {
- end_call_data = core_data->held;
- }
+ /* Set log presentation */
+ if (is_ecc) {
+ log_data->presentation = CM_CT_PLOG_PRESENT_EMERGENCY;
+ } else if (end_call_data && end_call_data->is_voicemail_number) {
+ log_data->presentation = CM_CT_PLOG_PRESENT_VOICEMAIL;
+ } else {
+ cm_telephony_name_mode_e name_mode = CM_TEL_NAME_MODE_NONE;
+ _callmgr_telephony_get_call_name_mode(call_data_out, &name_mode);
+ if (name_mode == CM_TEL_NAME_MODE_UNKNOWN) {
+ log_data->presentation = CM_CT_PLOG_PRESENT_UNAVAILABLE;
+ } else if (name_mode == CM_TEL_NAME_MODE_PRIVATE) {
+ log_data->presentation = CM_CT_PLOG_PRESENT_REJECT_BY_USER;
+ } else if (name_mode == CM_TEL_NAME_MODE_PAYPHONE) {
+ log_data->presentation = CM_CT_PLOG_PRESENT_PAYPHONE;
+ } else {
+ log_data->presentation = CM_CT_PLOG_PRESENT_DEFAULT;
+ }
+ }
- /* Set log presentation */
- if (is_ecc) {
- log_data->presentation = CM_CT_PLOG_PRESENT_EMERGENCY;
- } else if (end_call_data && end_call_data->is_voicemail_number) {
- log_data->presentation = CM_CT_PLOG_PRESENT_VOICEMAIL;
- } else {
- cm_telephony_name_mode_e name_mode = CM_TEL_NAME_MODE_NONE;
- _callmgr_telephony_get_call_name_mode(call_data_out, &name_mode);
- if (name_mode == CM_TEL_NAME_MODE_UNKNOWN) {
- log_data->presentation = CM_CT_PLOG_PRESENT_UNAVAILABLE;
- }
- else if (name_mode == CM_TEL_NAME_MODE_PRIVATE) {
- log_data->presentation = CM_CT_PLOG_PRESENT_REJECT_BY_USER;
- }
- else if (name_mode == CM_TEL_NAME_MODE_PAYPHONE) {
- log_data->presentation = CM_CT_PLOG_PRESENT_PAYPHONE;
- }
- else {
- log_data->presentation = CM_CT_PLOG_PRESENT_DEFAULT;
+ /* Set log type */
+ if (call_direction == CM_TEL_CALL_DIRECTION_MT) {
+ if (call_state == CM_TEL_CALL_STATE_INCOMING) {
+ if (reject_type == CM_CT_PLOG_REJECT_TYPE_NORMAL_E) {
+ if (cm_call_type == CALL_TYPE_VIDEO_E) {
+ log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_REJECT_E;
+ } else {
+ log_data->log_type = CM_CT_PLOG_TYPE_VOICE_REJECT_E;
}
- }
-
- /* Set log type */
- if (call_direction == CM_TEL_CALL_DIRECTION_MT) {
- if (call_state == CM_TEL_CALL_STATE_INCOMING) {
- if (reject_type == CM_CT_PLOG_REJECT_TYPE_NORMAL_E) {
- if (cm_call_type == CALL_TYPE_VIDEO_E) {
- log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_REJECT_E;
- }
- else {
- log_data->log_type = CM_CT_PLOG_TYPE_VOICE_REJECT_E;
- }
- }
- else if (reject_type == CM_CT_PLOG_REJECT_TYPE_BLOCKED_E) {
- if (cm_call_type == CALL_TYPE_VIDEO_E) {
- log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_BLOCKED_E;
- }
- else {
- log_data->log_type = CM_CT_PLOG_TYPE_VOICE_BLOCKED_E;
- }
- }
- else if (reject_type == CM_CT_PLOG_REJECT_TYPE_SETTING_REJECT_E) {
- if (cm_call_type == CALL_TYPE_VIDEO_E) {
- log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_BLOCKED_E;
- }
- else {
- log_data->log_type = CM_CT_PLOG_TYPE_VOICE_BLOCKED_E;
- }
- }
- else if (reject_type == CM_CT_PLOG_REJECT_TYPE_REC_REJECT_E) {
- if (cm_call_type == CALL_TYPE_VIDEO_E) {
- log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_BLOCKED_E;
- }
- else {
- log_data->log_type = CM_CT_PLOG_TYPE_VOICE_BLOCKED_E;
- }
- }
- else {
- if (cm_call_type == CALL_TYPE_VIDEO_E) {
- log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_INCOMING_UNSEEN_E;
- }
- else {
- log_data->log_type = CM_CT_PLOG_TYPE_VOICE_INCOMING_UNSEEN_E;
- }
- }
- b_play_effect_tone = FALSE;
+ } else if (reject_type == CM_CT_PLOG_REJECT_TYPE_BLOCKED_E) {
+ if (cm_call_type == CALL_TYPE_VIDEO_E) {
+ log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_BLOCKED_E;
+ } else {
+ log_data->log_type = CM_CT_PLOG_TYPE_VOICE_BLOCKED_E;
}
- else {
- if (cm_call_type == CALL_TYPE_VIDEO_E) {
- log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_INCOMING_E;
- }
- else {
- log_data->log_type = CM_CT_PLOG_TYPE_VOICE_INCOMING_E;
- }
+ } else if (reject_type == CM_CT_PLOG_REJECT_TYPE_SETTING_REJECT_E) {
+ if (cm_call_type == CALL_TYPE_VIDEO_E) {
+ log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_BLOCKED_E;
+ } else {
+ log_data->log_type = CM_CT_PLOG_TYPE_VOICE_BLOCKED_E;
}
- }
- else {
+ } else if (reject_type == CM_CT_PLOG_REJECT_TYPE_REC_REJECT_E) {
if (cm_call_type == CALL_TYPE_VIDEO_E) {
- log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_OUTGOING_E;
+ log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_BLOCKED_E;
+ } else {
+ log_data->log_type = CM_CT_PLOG_TYPE_VOICE_BLOCKED_E;
}
- else {
- log_data->log_type = CM_CT_PLOG_TYPE_VOICE_OUTGOING_E;
+ } else {
+ if (cm_call_type == CALL_TYPE_VIDEO_E) {
+ log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_INCOMING_UNSEEN_E;
+ } else {
+ log_data->log_type = CM_CT_PLOG_TYPE_VOICE_INCOMING_UNSEEN_E;
}
}
- _callmgr_ct_add_log(log_data);
- g_free(log_data);
+ b_play_effect_tone = FALSE;
+ } else {
+ if (cm_call_type == CALL_TYPE_VIDEO_E) {
+ log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_INCOMING_E;
+ } else {
+ log_data->log_type = CM_CT_PLOG_TYPE_VOICE_INCOMING_E;
+ }
+ }
+ } else {
+ if (cm_call_type == CALL_TYPE_VIDEO_E) {
+ log_data->log_type = CM_CT_PLOG_TYPE_VIDEO_OUTGOING_E;
+ } else {
+ log_data->log_type = CM_CT_PLOG_TYPE_VOICE_OUTGOING_E;
+ }
+ }
+ _callmgr_ct_add_log(log_data);
+ g_free(log_data);
- /* Delete the callData */
- _callmgr_telephony_call_delete(core_data->telephony_handle, call_id);
- _callmgr_ct_delete_ct_info(call_id);
- __callmgr_core_update_all_call_data(core_data);
+ /* Delete the callData */
+ _callmgr_telephony_call_delete(core_data->telephony_handle, call_id);
+ _callmgr_ct_delete_ct_info(call_id);
+ __callmgr_core_update_all_call_data(core_data);
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_IDLE_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, call_id);
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_IDLE_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, call_id);
- if (core_data->answer_msg_handle) {
- _callmgr_answer_msg_deinit(core_data->answer_msg_handle);
- core_data->answer_msg_handle = NULL;
+ if (core_data->answer_msg_handle) {
+ _callmgr_answer_msg_deinit(core_data->answer_msg_handle);
+ core_data->answer_msg_handle = NULL;
+ }
+ _callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
+
+ /* Destroy call session */
+ if (call_cnt == 0) {
+ int ret = -1;
+ callmgr_vr_state_e record_state = CALLMGR_VR_NONE;
+ cm_ringer_status_e ringer_status = CM_RINGER_STATUS_IDLE_E;
+
+ __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_IDLE_E, cm_call_type, NULL);
+
+ _callmgr_audio_set_media_mode_with_current_device();
+ if (call_direction == CM_TEL_CALL_DIRECTION_MO) {
+ callmgr_play_signal_type_e signal_type = CALL_SIGNAL_NONE_E;
+ __callmgr_core_get_signal_type(end_cause, &signal_type);
+ if (_callmgr_ringer_play_signal(core_data->ringer_handle, signal_type, __callmgr_core_signal_tone_finished_cb, core_data) == 0) {
+ err("_callmgr_ringer_play_signal() success");
+ b_play_effect_tone = FALSE;
}
- _callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
-
- /* Destroy call session */
- if (call_cnt == 0) {
- int ret = -1;
- callmgr_vr_state_e record_state = CALLMGR_VR_NONE;
- cm_ringer_status_e ringer_status = CM_RINGER_STATUS_IDLE_E;
-
- __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_IDLE_E, cm_call_type, NULL);
-
- _callmgr_audio_set_media_mode_with_current_device();
- if (call_direction == CM_TEL_CALL_DIRECTION_MO) {
- callmgr_play_signal_type_e signal_type = CALL_SIGNAL_NONE_E;
- __callmgr_core_get_signal_type(end_cause, &signal_type);
- if (_callmgr_ringer_play_signal(core_data->ringer_handle, signal_type, __callmgr_core_signal_tone_finished_cb, core_data) == 0) {
- err("_callmgr_ringer_play_signal() success");
- b_play_effect_tone = FALSE;
- }
- }
+ }
- _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
- if ((b_play_effect_tone) && (route != CALLMGR_AUDIO_ROUTE_BT_E)) {
- if (_callmgr_ringer_play_effect(core_data->ringer_handle, CM_RINGER_EFFECT_DISCONNECT_TONE_E, __callmgr_core_disconnect_tone_finished_cb, core_data) < 0) {
- err("_callmgr_ringer_play_effect() is failed");
- }
- }
+ _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
+ if ((b_play_effect_tone) && (route != CALLMGR_AUDIO_ROUTE_BT_E)) {
+ if (_callmgr_ringer_play_effect(core_data->ringer_handle, CM_RINGER_EFFECT_DISCONNECT_TONE_E, __callmgr_core_disconnect_tone_finished_cb, core_data) < 0) {
+ err("_callmgr_ringer_play_effect() is failed");
+ }
+ }
- _callmgr_ringer_get_ringer_status(core_data->ringer_handle, &ringer_status);
- if (ringer_status == CM_RINGER_STATUS_IDLE_E) {
- _callmgr_audio_destroy_call_sound_session(core_data->audio_handle);
- }
+ _callmgr_ringer_get_ringer_status(core_data->ringer_handle, &ringer_status);
+ if (ringer_status == CM_RINGER_STATUS_IDLE_E) {
+ _callmgr_audio_destroy_call_sound_session(core_data->audio_handle);
+ }
- /* When we make a call and switch on mute and then end the call, the next time we call the mute should be reset to off. So the below API is called here.*/
- _callmgr_telephony_set_audio_tx_mute(core_data->telephony_handle, FALSE);
- core_data->is_mute_on = FALSE;
- _callmgr_dbus_send_mute_status(core_data, 0);
- _callmgr_dbus_send_audio_status(core_data, CALL_AUDIO_PATH_NONE_E);
-
- _callmgr_vr_get_recording_state(core_data->vr_handle, &record_state);
- if (record_state == CALLMGR_VR_RECORD_REQUESTED ||
- record_state == CALLMGR_VR_RECORDING ||
- record_state == CALLMGR_VR_PAUSED) {
- ret = _callmgr_core_process_record_stop(core_data);
- if (ret < 0) {
- err("_callmgr_core_process_record_stop() failed[%d]", ret);
- }
- }
- core_data->is_auto_answered = FALSE;
- _callmgr_telephony_set_active_sim_slot(core_data->telephony_handle, CM_TELEPHONY_SIM_UNKNOWN);
- }
- else if (call_cnt > 0) {
- call_data_out = NULL;
- _callmgr_telephony_get_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_INCOMING, &call_data_out);
- if ((call_data_out == NULL) && (core_data->call_status != CALL_MANAGER_CALL_STATUS_OFFHOOK_E)) {
- __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_OFFHOOK_E, cm_call_type, NULL);
- }
- gboolean answer_requesting = FALSE;
- _callmgr_telephony_is_answer_requesting(core_data->telephony_handle, &answer_requesting);
- if ((call_cnt == 1) &&(call_data_out)) {
- // All other call is ended except incoming call. Restart to play ringtone
- if (!answer_requesting) {
- /* Release and Accept request is not done */
- char *caller_ringtone_path = NULL;
- unsigned int call_id = 0;
- _callmgr_telephony_get_call_id(call_data_out, &call_id);
-
- _callmgr_ct_get_caller_ringtone_path(call_id, &caller_ringtone_path);
- _callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_EARJACK_E, &is_earjack_connected);
- _callmgr_ringer_start_alert(core_data->ringer_handle, caller_ringtone_path, is_earjack_connected);
- CM_SAFE_FREE(caller_ringtone_path);
- }
- } else if (answer_requesting && (call_cnt > 1) && (call_data_out)) {
- /* Incoming + Other Calls Are Present. */
- gboolean is_held_call = FALSE;
- _callmgr_telephony_has_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_HELD, &is_held_call);
- if(FALSE == is_held_call) {
- /* All held call is ended... */
- cm_telephony_answer_request_type_e end_active_after_held_end = CM_TEL_INVALID;
- _callmgr_telephony_get_answer_request_type(core_data->telephony_handle, &end_active_after_held_end);
- if(CM_TEL_END_ACTIVE_AFTER_HELD_END == end_active_after_held_end) {
- info("End active call and accept incoming call...");
- _callmgr_core_process_answer_call(core_data, CM_TEL_CALL_ANSWER_TYPE_RELEASE_ACTIVE_AND_ACCEPT);
- } else if (CM_TEL_HOLD_ACTIVE_AFTER_HELD_END == end_active_after_held_end) {
- info("Hold active call and accept incoming call...");
- _callmgr_core_process_answer_call(core_data, CM_TEL_CALL_ANSWER_TYPE_HOLD_ACTIVE_AND_ACCEPT);
- }
- _callmgr_telephony_set_answer_request_type(core_data->telephony_handle, CM_TEL_INVALID);
- }
- }
+ /* When we make a call and switch on mute and then end the call, the next time we call the mute should be reset to off. So the below API is called here.*/
+ _callmgr_telephony_set_audio_tx_mute(core_data->telephony_handle, FALSE);
+ core_data->is_mute_on = FALSE;
+ _callmgr_dbus_send_mute_status(core_data, 0);
+ _callmgr_dbus_send_audio_status(core_data, CALL_AUDIO_PATH_NONE_E);
+
+ _callmgr_vr_get_recording_state(core_data->vr_handle, &record_state);
+ if (record_state == CALLMGR_VR_RECORD_REQUESTED ||
+ record_state == CALLMGR_VR_RECORDING ||
+ record_state == CALLMGR_VR_PAUSED) {
+ ret = _callmgr_core_process_record_stop(core_data);
+ if (ret < 0) {
+ err("_callmgr_core_process_record_stop() failed[%d]", ret);
}
}
- break;
- case CM_TELEPHONY_EVENT_ACTIVE:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
- cm_telephony_call_data_t *call_data_out = NULL;
- callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
- cm_telephony_call_type_e call_type = CM_TEL_CALL_TYPE_INVALID;
- gboolean is_bike_mode_enabled = FALSE;
-
- _callmgr_telephony_get_call_by_call_id(core_data->telephony_handle, call_id, &call_data_out);
- _callmgr_telephony_get_call_type(call_data_out, &call_type);
- __callmgr_core_convert_tel_call_type(call_type, &cm_call_type);
- /********setting the mute status to off initially which treats every call as new call ***/
- /*****and sets the mute status to off initially********/
- _callmgr_core_process_set_mute_state(core_data, 0);
-
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_ACTIVE_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_stop_incom_noti(core_data);
- _callmgr_ringer_stop_local_ringback_tone(core_data->ringer_handle);
-
- _callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
- if ((core_data->is_auto_answered) && (is_bike_mode_enabled)) {
- warn("Auto-answered call!![Bike Mode]");
- _callmgr_audio_set_link_direction_uplink();
- }
-
- _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
- if (route == CALLMGR_AUDIO_ROUTE_NONE_E) {
- _callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_BT_E, &is_bt_connected);
- if (is_bt_connected)
- _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_BT_E);
- else
- __callmgr_core_set_default_audio_route(core_data);
+ core_data->is_auto_answered = FALSE;
+ _callmgr_telephony_set_active_sim_slot(core_data->telephony_handle, CM_TELEPHONY_SIM_UNKNOWN);
+ } else if (call_cnt > 0) {
+ call_data_out = NULL;
+ _callmgr_telephony_get_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_INCOMING, &call_data_out);
+ if ((call_data_out == NULL) && (core_data->call_status != CALL_MANAGER_CALL_STATUS_OFFHOOK_E)) {
+ __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_OFFHOOK_E, cm_call_type, NULL);
+ }
+ gboolean answer_requesting = FALSE;
+ _callmgr_telephony_is_answer_requesting(core_data->telephony_handle, &answer_requesting);
+ if ((call_cnt == 1) && (call_data_out)) {
+ // All other call is ended except incoming call. Restart to play ringtone
+ if (!answer_requesting) {
+ /* Release and Accept request is not done */
+ char *caller_ringtone_path = NULL;
+ unsigned int call_id = 0;
+ _callmgr_telephony_get_call_id(call_data_out, &call_id);
+
+ _callmgr_ct_get_caller_ringtone_path(call_id, &caller_ringtone_path);
+ _callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_EARJACK_E, &is_earjack_connected);
+ _callmgr_ringer_start_alert(core_data->ringer_handle, caller_ringtone_path, is_earjack_connected);
+ CM_SAFE_FREE(caller_ringtone_path);
}
- else {
- gboolean is_ringtone_mode = FALSE;
-
- _callmgr_audio_is_ringtone_mode(core_data->audio_handle, &is_ringtone_mode);
- if (is_ringtone_mode) {
- /* Active > 2nd incoming > End active > Incoming > Active */
- /* We need to set previous audio route */
- warn("Set prev route");
- int ret = _callmgr_audio_set_audio_route(core_data->audio_handle, route);
- if (ret < 0) {
- err("_callmgr_audio_set_audio_route() fails");
- }
+ } else if (answer_requesting && (call_cnt > 1) && (call_data_out)) {
+ /* Incoming + Other Calls Are Present. */
+ gboolean is_held_call = FALSE;
+ _callmgr_telephony_has_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_HELD, &is_held_call);
+ if (FALSE == is_held_call) {
+ /* All held call is ended... */
+ cm_telephony_answer_request_type_e end_active_after_held_end = CM_TEL_INVALID;
+ _callmgr_telephony_get_answer_request_type(core_data->telephony_handle, &end_active_after_held_end);
+ if (CM_TEL_END_ACTIVE_AFTER_HELD_END == end_active_after_held_end) {
+ info("End active call and accept incoming call...");
+ _callmgr_core_process_answer_call(core_data, CM_TEL_CALL_ANSWER_TYPE_RELEASE_ACTIVE_AND_ACCEPT);
+ } else if (CM_TEL_HOLD_ACTIVE_AFTER_HELD_END == end_active_after_held_end) {
+ info("Hold active call and accept incoming call...");
+ _callmgr_core_process_answer_call(core_data, CM_TEL_CALL_ANSWER_TYPE_HOLD_ACTIVE_AND_ACCEPT);
}
+ _callmgr_telephony_set_answer_request_type(core_data->telephony_handle, CM_TEL_INVALID);
}
+ }
+ }
+ }
+ break;
+ case CM_TELEPHONY_EVENT_ACTIVE:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ cm_telephony_call_data_t *call_data_out = NULL;
+ callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
+ cm_telephony_call_type_e call_type = CM_TEL_CALL_TYPE_INVALID;
+ gboolean is_bike_mode_enabled = FALSE;
+
+ _callmgr_telephony_get_call_by_call_id(core_data->telephony_handle, call_id, &call_data_out);
+ _callmgr_telephony_get_call_type(call_data_out, &call_type);
+ __callmgr_core_convert_tel_call_type(call_type, &cm_call_type);
+ /********setting the mute status to off initially which treats every call as new call ***/
+ /*****and sets the mute status to off initially********/
+ _callmgr_core_process_set_mute_state(core_data, 0);
+
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_ACTIVE_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_stop_incom_noti(core_data);
+ _callmgr_ringer_stop_local_ringback_tone(core_data->ringer_handle);
- if (core_data->call_status != CALL_MANAGER_CALL_STATUS_OFFHOOK_E) {
- __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_OFFHOOK_E, cm_call_type, NULL);
- }
+ _callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
+ if ((core_data->is_auto_answered) && (is_bike_mode_enabled)) {
+ warn("Auto-answered call!![Bike Mode]");
+ _callmgr_audio_set_link_direction_uplink();
+ }
- __callmgr_core_send_bt_events(core_data, 0);
-
- __callmgr_core_process_dtmf_number(core_data);
-
- if ((core_data->is_auto_answered) && (is_bike_mode_enabled)) {
- warn("Auto-answered call!![Bike Mode]");
- // Play answer msg
- if (_callmgr_answer_msg_init(&core_data->answer_msg_handle) < 0) {
- err("_callmgr_answer_msg_init() failed");
- _callmgr_core_process_end_call(core_data, call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE);
- core_data->is_auto_answered = FALSE;
- } else if (_callmgr_answer_msg_play_msg(core_data->answer_msg_handle, __callmgr_core_answer_msg_finished_cb, core_data) < 0) {
- _callmgr_core_process_end_call(core_data, call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE);
- _callmgr_answer_msg_deinit(core_data->answer_msg_handle);
- core_data->answer_msg_handle = NULL;
- core_data->is_auto_answered = FALSE;
- }
+ _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
+ if (route == CALLMGR_AUDIO_ROUTE_NONE_E) {
+ _callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_BT_E, &is_bt_connected);
+ if (is_bt_connected)
+ _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_BT_E);
+ else
+ __callmgr_core_set_default_audio_route(core_data);
+ } else {
+ gboolean is_ringtone_mode = FALSE;
+
+ _callmgr_audio_is_ringtone_mode(core_data->audio_handle, &is_ringtone_mode);
+ if (is_ringtone_mode) {
+ /* Active > 2nd incoming > End active > Incoming > Active */
+ /* We need to set previous audio route */
+ warn("Set prev route");
+ int ret = _callmgr_audio_set_audio_route(core_data->audio_handle, route);
+ if (ret < 0) {
+ err("_callmgr_audio_set_audio_route() fails");
}
}
- break;
- case CM_TELEPHONY_EVENT_HELD:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ }
+
+ if (core_data->call_status != CALL_MANAGER_CALL_STATUS_OFFHOOK_E) {
+ __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_OFFHOOK_E, cm_call_type, NULL);
+ }
+
+ __callmgr_core_send_bt_events(core_data, 0);
+
+ __callmgr_core_process_dtmf_number(core_data);
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_HELD_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, 0);
+ if ((core_data->is_auto_answered) && (is_bike_mode_enabled)) {
+ warn("Auto-answered call!![Bike Mode]");
+ // Play answer msg
+ if (_callmgr_answer_msg_init(&core_data->answer_msg_handle) < 0) {
+ err("_callmgr_answer_msg_init() failed");
+ _callmgr_core_process_end_call(core_data, call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE);
+ core_data->is_auto_answered = FALSE;
+ } else if (_callmgr_answer_msg_play_msg(core_data->answer_msg_handle, __callmgr_core_answer_msg_finished_cb, core_data) < 0) {
+ _callmgr_core_process_end_call(core_data, call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE);
+ _callmgr_answer_msg_deinit(core_data->answer_msg_handle);
+ core_data->answer_msg_handle = NULL;
+ core_data->is_auto_answered = FALSE;
}
- break;
- case CM_TELEPHONY_EVENT_DIALING:
- {
- int ret = 0;
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
- char *number = NULL;
- callmgr_contact_info_t *contact_out_info = NULL;
- cm_telephony_call_data_t *call_data_out = NULL;
- cm_telephony_call_type_e tel_call_type = CM_TEL_CALL_TYPE_INVALID;
- callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
- callmgr_audio_session_mode_e sound_mode = CALLMGR_AUDIO_SESSION_NONE_E;
-
- _callmgr_telephony_get_call_by_call_id(core_data->telephony_handle, call_id, &call_data_out);
- /*Update Contact Info in contact list*/
- if (call_data_out) {
- _callmgr_telephony_get_call_type(call_data_out, &tel_call_type);
- _callmgr_telephony_get_call_number(call_data_out, &number);
- _callmgr_ct_add_ct_info((const char *)number, call_id, &contact_out_info);
- if (contact_out_info) {
- int person_id = -1;
- _callmgr_ct_get_person_id(call_id, &person_id);
- dbg("Contact Info added successfully for CallId : %d, ContactIdx : %d", call_id, person_id);
- } else {
- err("Failed to add contact object");
- }
+ }
+ }
+ break;
+ case CM_TELEPHONY_EVENT_HELD:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
- g_free(number);
- }
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_HELD_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, 0);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_DIALING:
+ {
+ int ret = 0;
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ char *number = NULL;
+ callmgr_contact_info_t *contact_out_info = NULL;
+ cm_telephony_call_data_t *call_data_out = NULL;
+ cm_telephony_call_type_e tel_call_type = CM_TEL_CALL_TYPE_INVALID;
+ callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
+ callmgr_audio_session_mode_e sound_mode = CALLMGR_AUDIO_SESSION_NONE_E;
+
+ _callmgr_telephony_get_call_by_call_id(core_data->telephony_handle, call_id, &call_data_out);
+ /*Update Contact Info in contact list*/
+ if (call_data_out) {
+ _callmgr_telephony_get_call_type(call_data_out, &tel_call_type);
+ _callmgr_telephony_get_call_number(call_data_out, &number);
+ _callmgr_ct_add_ct_info((const char *)number, call_id, &contact_out_info);
+ if (contact_out_info) {
+ int person_id = -1;
+ _callmgr_ct_get_person_id(call_id, &person_id);
+ dbg("Contact Info added successfully for CallId : %d, ContactIdx : %d", call_id, person_id);
+ } else {
+ err("Failed to add contact object");
+ }
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_DIALING_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, 0);
+ g_free(number);
+ }
- __callmgr_core_convert_tel_call_type(tel_call_type, &cm_call_type);
- if(CALL_TYPE_VOICE_E == cm_call_type) {
- sound_mode = CALLMGR_AUDIO_SESSION_VOICE_E;
- } else {
- sound_mode = CALLMGR_AUDIO_SESSION_VIDEO_E;
- }
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_DIALING_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, 0);
- _callmgr_ringer_stop_signal(core_data->ringer_handle);
- _callmgr_ringer_stop_effect(core_data->ringer_handle);
+ __callmgr_core_convert_tel_call_type(tel_call_type, &cm_call_type);
+ if (CALL_TYPE_VOICE_E == cm_call_type) {
+ sound_mode = CALLMGR_AUDIO_SESSION_VOICE_E;
+ } else {
+ sound_mode = CALLMGR_AUDIO_SESSION_VIDEO_E;
+ }
- ret = _callmgr_audio_create_call_sound_session(core_data->audio_handle, sound_mode);
- if (ret < 0) {
- err("_callmgr_audio_create_call_sound_session() failed");
- }
+ _callmgr_ringer_stop_signal(core_data->ringer_handle);
+ _callmgr_ringer_stop_effect(core_data->ringer_handle);
- _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
- if (route == CALLMGR_AUDIO_ROUTE_NONE_E) {
- _callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_BT_E, &is_bt_connected);
- if (is_bt_connected)
- _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_BT_E);
- else
- __callmgr_core_set_default_audio_route(core_data);
- }
+ ret = _callmgr_audio_create_call_sound_session(core_data->audio_handle, sound_mode);
+ if (ret < 0) {
+ err("_callmgr_audio_create_call_sound_session() failed");
+ }
- if (core_data->call_status != CALL_MANAGER_CALL_STATUS_OFFHOOK_E) {
- __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_OFFHOOK_E, cm_call_type, NULL);
- }
- }
- break;
- case CM_TELEPHONY_EVENT_ALERT:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
+ if (route == CALLMGR_AUDIO_ROUTE_NONE_E) {
+ _callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_BT_E, &is_bt_connected);
+ if (is_bt_connected)
+ _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_BT_E);
+ else
+ __callmgr_core_set_default_audio_route(core_data);
+ }
- _callmgr_ringer_play_effect(core_data->ringer_handle, CM_RINGER_EFFECT_CONNECT_TONE_E, NULL, NULL);
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_ALERT_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, 0);
- }
- break;
- case CM_TELEPHONY_EVENT_INCOMING:
- {
- cm_telephony_call_data_t *call = (cm_telephony_call_data_t *)event_data;
- callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
- cm_telephony_call_type_e call_type = CM_TEL_CALL_TYPE_INVALID;
-
- if (call) {
- char *number = NULL;
- _callmgr_telephony_get_call_number(call, &number);
- gboolean is_blocked_num = FALSE;
- gboolean is_rec_blocked = FALSE;
- gboolean is_bike_mode_enabled = FALSE;
- gboolean is_low_battery = FALSE;
- int call_cnt = -1;
- gboolean is_do_not_disturb = FALSE;
-
- _callmgr_telephony_get_call_type(call, &call_type);
- __callmgr_core_convert_tel_call_type(call_type, &cm_call_type);
-
- /* Video call does not support on SPIN. Reject video call */
- if (cm_call_type == CALL_TYPE_VIDEO_E) {
- warn("Video call does not support currently! Rejecting incoming call");
- _callmgr_telephony_reject_call(core_data->telephony_handle);
- g_free(number);
- return;
- }
+ if (core_data->call_status != CALL_MANAGER_CALL_STATUS_OFFHOOK_E) {
+ __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_OFFHOOK_E, cm_call_type, NULL);
+ }
+ }
+ break;
+ case CM_TELEPHONY_EVENT_ALERT:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
- _callmgr_util_check_block_mode_num(number, &is_blocked_num);
- _callmgr_vconf_is_recording_reject_enabled(&is_rec_blocked);
- _callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
- _callmgr_vconf_is_low_battery(&is_low_battery);
-
- _callmgr_util_check_disturbing_setting(number, &is_do_not_disturb);
- _callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
- if((is_blocked_num == TRUE)
- || (is_rec_blocked == TRUE)
- || (is_do_not_disturb == TRUE)
- || ((is_bike_mode_enabled == TRUE) && (call_cnt > 1)) // if 2nd incoming call
- || ((is_bike_mode_enabled == TRUE) && (cm_call_type == CALL_TYPE_VIDEO_E))) {
- warn("Auto reject incoming call");
- callmgr_contact_info_t *contact_out_info = NULL;
-
- int ret = _callmgr_telephony_reject_call(core_data->telephony_handle);
- if (ret < 0) {
- err("_callmgr_telephony_reject_call() get failed");
- }
- /* Add contact info for blocked number */
- _callmgr_ct_add_ct_info((const char *)number, core_data->incom->call_id, &contact_out_info);
-
- if (is_rec_blocked) {
- _callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_REC_REJECT_E);
- } else if (is_do_not_disturb) {
- _callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_SETTING_REJECT_E);
- } else {
- _callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_BLOCKED_E);
- }
- } else if ((is_low_battery == TRUE) && (cm_call_type == CALL_TYPE_VIDEO_E)) {
- warn("Low battery video call");
- /* Low battery is lower priority than other block cause */
- callmgr_contact_info_t *contact_out_info = NULL;
-
- int ret = _callmgr_telephony_reject_call(core_data->telephony_handle);
- if (ret < 0) {
- err("_callmgr_telephony_reject_call() get failed");
- }
- _callmgr_ct_add_ct_info((const char *)number, core_data->incom->call_id, &contact_out_info);
- _callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_BLOCKED_E);
-
- _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_LOW_BATTERY_INCOMING, NULL, 0, NULL, NULL);
- } else {
- __callmgr_core_process_incoming_call(core_data, call, active_sim_slot);
- __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_RINGING_E, cm_call_type, number);
- }
- g_free(number);
- break;
- }
- }
- break;
- case CM_TELEPHONY_EVENT_WAITING:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_WAITING_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, 0);
- }
- break;
- case CM_TELEPHONY_EVENT_JOIN:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_JOIN_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, 0);
- }
- break;
- case CM_TELEPHONY_EVENT_SPLIT:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_SPLIT_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, 0);
- }
- break;
- case CM_TELEPHONY_EVENT_SWAP:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_SWAP_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, 0);
- }
- break;
- case CM_TELEPHONY_EVENT_RETRIEVED:
- {
- unsigned int call_id = GPOINTER_TO_UINT(event_data);
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_RETRIEVED_E, call_id, active_sim_slot, end_cause);
- __callmgr_core_send_bt_events(core_data, 0);
+ _callmgr_ringer_play_effect(core_data->ringer_handle, CM_RINGER_EFFECT_CONNECT_TONE_E, NULL, NULL);
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_ALERT_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, 0);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_INCOMING:
+ {
+ cm_telephony_call_data_t *call = (cm_telephony_call_data_t *)event_data;
+ callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
+ cm_telephony_call_type_e call_type = CM_TEL_CALL_TYPE_INVALID;
+
+ if (call) {
+ char *number = NULL;
+ _callmgr_telephony_get_call_number(call, &number);
+ gboolean is_blocked_num = FALSE;
+ gboolean is_rec_blocked = FALSE;
+ gboolean is_bike_mode_enabled = FALSE;
+ gboolean is_low_battery = FALSE;
+ int call_cnt = -1;
+ gboolean is_do_not_disturb = FALSE;
+
+ _callmgr_telephony_get_call_type(call, &call_type);
+ __callmgr_core_convert_tel_call_type(call_type, &cm_call_type);
+
+ /* Video call does not support on SPIN. Reject video call */
+ if (cm_call_type == CALL_TYPE_VIDEO_E) {
+ warn("Video call does not support currently! Rejecting incoming call");
+ _callmgr_telephony_reject_call(core_data->telephony_handle);
+ g_free(number);
+ return;
}
- break;
- case CM_TELEPHONY_EVENT_NETWORK_ERROR:
- {
- int result = GPOINTER_TO_INT(event_data);
- if (result == CM_TEL_CALL_ERR_NONE) {
- _callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_SUCCESS);
- }
- else {
- cm_telephony_call_data_t *call = NULL;
- if (result == CM_TEL_CALL_ERR_FDN_ONLY) {
- _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_FDN_CALL_ONLY, NULL, 0, NULL, NULL);
- _callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_FAIL_FDN);
- }
- else if (result == CM_TEL_CALL_ERR_FM_OFF_FAIL) {
- _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_FAILED, NULL, 0, NULL, NULL);
- _callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_FAIL_FLIGHT_MODE);
- }
- else {
- _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_FAILED, NULL, 0, NULL, NULL);
- _callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_FAIL);
- }
+ _callmgr_util_check_block_mode_num(number, &is_blocked_num);
+ _callmgr_vconf_is_recording_reject_enabled(&is_rec_blocked);
+ _callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
+ _callmgr_vconf_is_low_battery(&is_low_battery);
- if (result == CM_TEL_CALL_ERR_REJ_SAT_CALL_CTRL) {
- dbg("will send TR soon when CALL_CONTROL indication coming.")
- } else {
- if (_callmgr_telephony_get_sat_originated_call(core_data->telephony_handle, &call) == 0) {
- _callmgr_telephony_send_sat_response(core_data->telephony_handle,
- CM_TELEPHONY_SAT_EVENT_SETUP_CALL, CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND, CM_TELEPHONY_SIM_UNKNOWN);
- }
- }
- }
- }
- break;
- case CM_TELEPHONY_EVENT_SOUND_WBAMR:
- {
- //int wb_status = (int)event_data;
- /* ToDo : We need to set WB information and update it */
- }
- break;
+ _callmgr_util_check_disturbing_setting(number, &is_do_not_disturb);
+ _callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
+ if ((is_blocked_num == TRUE)
+ || (is_rec_blocked == TRUE)
+ || (is_do_not_disturb == TRUE)
+ || ((is_bike_mode_enabled == TRUE) && (call_cnt > 1)) // if 2nd incoming call
+ || ((is_bike_mode_enabled == TRUE) && (cm_call_type == CALL_TYPE_VIDEO_E))) {
+ warn("Auto reject incoming call");
+ callmgr_contact_info_t *contact_out_info = NULL;
- case CM_TELEPHONY_EVENT_SOUND_CLOCK_STATUS:
- {
- /* ToDo : We need to set path for this event */
- }
- break;
- case CM_TELEPHONY_EVENT_SOUND_RINGBACK_TONE:
- {
- int ringbacktone_info = GPOINTER_TO_INT(event_data);
- /* play /stop ringback tone */
- info("ringback info received = %d ", ringbacktone_info);
-
- if (ringbacktone_info == 1) {
- _callmgr_ringer_play_local_ringback_tone(core_data->ringer_handle);
+ int ret = _callmgr_telephony_reject_call(core_data->telephony_handle);
+ if (ret < 0) {
+ err("_callmgr_telephony_reject_call() get failed");
}
- }
- break;
- case CM_TELEPHONY_EVENT_SS_INFO:
- {
- int info_type = GPOINTER_TO_INT(event_data);
- _callmgr_util_launch_popup(CALL_POPUP_SS_INFO, info_type, NULL, 0, NULL, NULL);
- }
- break;
- case CM_TELEPHONY_EVENT_FLIGHT_MODE_TIME_OVER_E:
- {
- cm_telephony_call_data_t *call = NULL;
- int ret = 0;
- _callmgr_util_launch_popup(CALL_POPUP_HIDE, CALL_ERR_NONE, NULL, 0, NULL, NULL);
+ /* Add contact info for blocked number */
+ _callmgr_ct_add_ct_info((const char *)number, core_data->incom->call_id, &contact_out_info);
- ret = _callmgr_telephony_get_call_by_call_id(core_data->telephony_handle, NO_CALL_HANDLE, &call);
- if (ret < 0 || call == NULL) {
- warn("Invalid call");
- _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_FAILED, NULL, 0, NULL, NULL);
+ if (is_rec_blocked) {
+ _callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_REC_REJECT_E);
+ } else if (is_do_not_disturb) {
+ _callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_SETTING_REJECT_E);
+ } else {
+ _callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_BLOCKED_E);
}
- else {
- ret = _callmgr_telephony_dial(core_data->telephony_handle, call);
- if (ret < 0) {
- err("_callmgr_telephony_dial get failed");
- _callmgr_telephony_call_delete(core_data->telephony_handle, NO_CALL_HANDLE);
- }
+ } else if ((is_low_battery == TRUE) && (cm_call_type == CALL_TYPE_VIDEO_E)) {
+ warn("Low battery video call");
+ /* Low battery is lower priority than other block cause */
+ callmgr_contact_info_t *contact_out_info = NULL;
+
+ int ret = _callmgr_telephony_reject_call(core_data->telephony_handle);
+ if (ret < 0) {
+ err("_callmgr_telephony_reject_call() get failed");
}
+ _callmgr_ct_add_ct_info((const char *)number, core_data->incom->call_id, &contact_out_info);
+ _callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_BLOCKED_E);
+
+ _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_LOW_BATTERY_INCOMING, NULL, 0, NULL, NULL);
+ } else {
+ __callmgr_core_process_incoming_call(core_data, call, active_sim_slot);
+ __callmgr_core_set_call_status(core_data, CALL_MANAGER_CALL_STATUS_RINGING_E, cm_call_type, number);
}
+ g_free(number);
break;
- case CM_TELEPHONY_EVENT_PREFERRED_SIM_CHANGED:
- {
- int preferred_sim = GPOINTER_TO_INT(event_data);
- info("preferred SIM [%d]", preferred_sim);
- _callmgr_util_launch_popup(CALL_POPUP_HIDE, CALL_ERR_NONE, NULL, 0, NULL, NULL);
+ }
+ }
+ break;
+ case CM_TELEPHONY_EVENT_WAITING:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_WAITING_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, 0);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_JOIN:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_JOIN_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, 0);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_SPLIT:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_SPLIT_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, 0);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_SWAP:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_SWAP_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, 0);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_RETRIEVED:
+ {
+ unsigned int call_id = GPOINTER_TO_UINT(event_data);
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_RETRIEVED_E, call_id, active_sim_slot, end_cause);
+ __callmgr_core_send_bt_events(core_data, 0);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_NETWORK_ERROR:
+ {
+ int result = GPOINTER_TO_INT(event_data);
+ if (result == CM_TEL_CALL_ERR_NONE) {
+ _callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_SUCCESS);
+ } else {
+ cm_telephony_call_data_t *call = NULL;
+
+ if (result == CM_TEL_CALL_ERR_FDN_ONLY) {
+ _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_FDN_CALL_ONLY, NULL, 0, NULL, NULL);
+ _callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_FAIL_FDN);
+ } else if (result == CM_TEL_CALL_ERR_FM_OFF_FAIL) {
+ _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_FAILED, NULL, 0, NULL, NULL);
+ _callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_FAIL_FLIGHT_MODE);
+ } else {
+ _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_FAILED, NULL, 0, NULL, NULL);
+ _callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_FAIL);
}
- break;
- case CM_TELEPHONY_EVENT_SAT_SETUP_CALL:
- {
- int ret = 0;
- char *number = NULL, *name = NULL;
- cm_telephony_sat_setup_call_type_e sat_setup_call_type = CM_TELEPHONY_SAT_SETUP_CALL_RESERVED;
- int call_cnt = 0;
-
- _callmgr_telephony_get_sat_setup_call_number(core_data->telephony_handle, &number);
- _callmgr_telephony_get_sat_setup_call_name(core_data->telephony_handle, &name);
- _callmgr_telephony_get_sat_setup_call_type(core_data->telephony_handle, &sat_setup_call_type);
- _callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
-
- if (!number) {
- err("number is NULL.");
- goto SAT_SETUP_CALL_FAIL_EXIT;
+
+ if (result == CM_TEL_CALL_ERR_REJ_SAT_CALL_CTRL) {
+ dbg("will send TR soon when CALL_CONTROL indication coming.")
+ } else {
+ if (_callmgr_telephony_get_sat_originated_call(core_data->telephony_handle, &call) == 0) {
+ _callmgr_telephony_send_sat_response(core_data->telephony_handle,
+ CM_TELEPHONY_SAT_EVENT_SETUP_CALL, CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND, CM_TELEPHONY_SIM_UNKNOWN);
}
+ }
+ }
+ }
+ break;
+ case CM_TELEPHONY_EVENT_SOUND_WBAMR:
+ {
+ //int wb_status = (int)event_data;
+ /* ToDo : We need to set WB information and update it */
+ }
+ break;
- info("setup_call_type(%d), number(%s), name(%s), current call_cnt(%d)", sat_setup_call_type, number, name, call_cnt);
+ case CM_TELEPHONY_EVENT_SOUND_CLOCK_STATUS:
+ {
+ /* ToDo : We need to set path for this event */
+ }
+ break;
+ case CM_TELEPHONY_EVENT_SOUND_RINGBACK_TONE:
+ {
+ int ringbacktone_info = GPOINTER_TO_INT(event_data);
+ /* play /stop ringback tone */
+ info("ringback info received = %d ", ringbacktone_info);
+
+ if (ringbacktone_info == 1) {
+ _callmgr_ringer_play_local_ringback_tone(core_data->ringer_handle);
+ }
+ }
+ break;
+ case CM_TELEPHONY_EVENT_SS_INFO:
+ {
+ int info_type = GPOINTER_TO_INT(event_data);
+ _callmgr_util_launch_popup(CALL_POPUP_SS_INFO, info_type, NULL, 0, NULL, NULL);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_FLIGHT_MODE_TIME_OVER_E:
+ {
+ cm_telephony_call_data_t *call = NULL;
+ int ret = 0;
+ _callmgr_util_launch_popup(CALL_POPUP_HIDE, CALL_ERR_NONE, NULL, 0, NULL, NULL);
+
+ ret = _callmgr_telephony_get_call_by_call_id(core_data->telephony_handle, NO_CALL_HANDLE, &call);
+ if (ret < 0 || call == NULL) {
+ warn("Invalid call");
+ _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_FAILED, NULL, 0, NULL, NULL);
+ } else {
+ ret = _callmgr_telephony_dial(core_data->telephony_handle, call);
+ if (ret < 0) {
+ err("_callmgr_telephony_dial get failed");
+ _callmgr_telephony_call_delete(core_data->telephony_handle, NO_CALL_HANDLE);
+ }
+ }
+ }
+ break;
+ case CM_TELEPHONY_EVENT_PREFERRED_SIM_CHANGED:
+ {
+ int preferred_sim = GPOINTER_TO_INT(event_data);
+ info("preferred SIM [%d]", preferred_sim);
+ _callmgr_util_launch_popup(CALL_POPUP_HIDE, CALL_ERR_NONE, NULL, 0, NULL, NULL);
+ }
+ break;
+ case CM_TELEPHONY_EVENT_SAT_SETUP_CALL:
+ {
+ int ret = 0;
+ char *number = NULL, *name = NULL;
+ cm_telephony_sat_setup_call_type_e sat_setup_call_type = CM_TELEPHONY_SAT_SETUP_CALL_RESERVED;
+ int call_cnt = 0;
+
+ _callmgr_telephony_get_sat_setup_call_number(core_data->telephony_handle, &number);
+ _callmgr_telephony_get_sat_setup_call_name(core_data->telephony_handle, &name);
+ _callmgr_telephony_get_sat_setup_call_type(core_data->telephony_handle, &sat_setup_call_type);
+ _callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
+
+ if (!number) {
+ err("number is NULL.");
+ goto SAT_SETUP_CALL_FAIL_EXIT;
+ }
- if (call_cnt > 0) {
- switch (sat_setup_call_type) {
- case CM_TELEPHONY_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL:
- case CM_TELEPHONY_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY:
- warn("There is another call. send fail TR.");
+ info("setup_call_type(%d), number(%s), name(%s), current call_cnt(%d)", sat_setup_call_type, number, name, call_cnt);
+
+ if (call_cnt > 0) {
+ switch (sat_setup_call_type) {
+ case CM_TELEPHONY_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL:
+ case CM_TELEPHONY_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY:
+ warn("There is another call. send fail TR.");
+ goto SAT_SETUP_CALL_FAIL_EXIT;
+ break;
+ case CM_TELEPHONY_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD_WITH_REDIAL:
+ case CM_TELEPHONY_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD:
+ if (core_data->incom) {
+ warn("There is incoming call.");
+ goto SAT_SETUP_CALL_FAIL_EXIT;
+ } else if (core_data->active_dial) {
+ if (core_data->active_dial->call_state == CM_TEL_CALL_STATE_DIALING
+ || core_data->active_dial->call_state == CM_TEL_CALL_STATE_ALERT) {
+ warn("Call is dialing or alerting.");
goto SAT_SETUP_CALL_FAIL_EXIT;
- break;
- case CM_TELEPHONY_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD_WITH_REDIAL:
- case CM_TELEPHONY_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD:
- if (core_data->incom) {
- warn("There is incoming call.");
- goto SAT_SETUP_CALL_FAIL_EXIT;
- } else if (core_data->active_dial) {
- if (core_data->active_dial->call_state == CM_TEL_CALL_STATE_DIALING
- || core_data->active_dial->call_state == CM_TEL_CALL_STATE_ALERT) {
- warn("Call is dialing or alerting.");
- goto SAT_SETUP_CALL_FAIL_EXIT;
- } else if (core_data->held) {
- warn("There are already 2 calls which active & held.");
- goto SAT_SETUP_CALL_FAIL_EXIT;
- }
-
- info("Put all other calls on hold. after that request setup call.")
- ret = _callmgr_telephony_hold_call(core_data->telephony_handle);
- if (ret < 0) {
- err("_callmgr_telephony_hold_call[%d] failed.", ret);
- goto SAT_SETUP_CALL_FAIL_EXIT;
- }
- return;
- }
- break;
- case CM_TELEPHONY_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS_WITH_REDIAL:
- case CM_TELEPHONY_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS:
- info("Disconnect all other calls. after that request setup call.")
- ret = _callmgr_core_process_end_call(core_data, 0, CM_TEL_CALL_RELEASE_TYPE_ALL_CALLS);
- if (ret < 0) {
- err("_callmgr_core_process_end_call[%d] failed.", ret);
- goto SAT_SETUP_CALL_FAIL_EXIT;
- }
- return;
- break;
- default:
- warn("Unhandled type[%d]", sat_setup_call_type);
+ } else if (core_data->held) {
+ warn("There are already 2 calls which active & held.");
goto SAT_SETUP_CALL_FAIL_EXIT;
- break;
}
- } else {
- callmgr_audio_session_mode_e session_mode = CALLMGR_AUDIO_SESSION_NONE_E;
- _callmgr_audio_get_session_mode(core_data->audio_handle, &session_mode);
- if (session_mode == CALLMGR_AUDIO_SESSION_VIDEO_E) {
- warn("VT remain");
- /* VT session was not destroyed. Send fail response for SAT */
+
+ info("Put all other calls on hold. after that request setup call.")
+ ret = _callmgr_telephony_hold_call(core_data->telephony_handle);
+ if (ret < 0) {
+ err("_callmgr_telephony_hold_call[%d] failed.", ret);
goto SAT_SETUP_CALL_FAIL_EXIT;
}
+ return;
}
-
- ret = _callmgr_util_launch_callui_by_sat(active_sim_slot);
- if (ret != 0) {
- err("_callmgr_util_launch_callui_by_sat() is failed[%d].", ret);
+ break;
+ case CM_TELEPHONY_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS_WITH_REDIAL:
+ case CM_TELEPHONY_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS:
+ info("Disconnect all other calls. after that request setup call.")
+ ret = _callmgr_core_process_end_call(core_data, 0, CM_TEL_CALL_RELEASE_TYPE_ALL_CALLS);
+ if (ret < 0) {
+ err("_callmgr_core_process_end_call[%d] failed.", ret);
goto SAT_SETUP_CALL_FAIL_EXIT;
}
+ return;
+ break;
+ default:
+ warn("Unhandled type[%d]", sat_setup_call_type);
+ goto SAT_SETUP_CALL_FAIL_EXIT;
+ break;
+ }
+ } else {
+ callmgr_audio_session_mode_e session_mode = CALLMGR_AUDIO_SESSION_NONE_E;
+ _callmgr_audio_get_session_mode(core_data->audio_handle, &session_mode);
+ if (session_mode == CALLMGR_AUDIO_SESSION_VIDEO_E) {
+ warn("VT remain");
+ /* VT session was not destroyed. Send fail response for SAT */
+ goto SAT_SETUP_CALL_FAIL_EXIT;
+ }
+ }
+
+ ret = _callmgr_util_launch_callui_by_sat(active_sim_slot);
+ if (ret != 0) {
+ err("_callmgr_util_launch_callui_by_sat() is failed[%d].", ret);
+ goto SAT_SETUP_CALL_FAIL_EXIT;
+ }
- ret = _callmgr_core_process_dial(core_data, number, CALL_TYPE_VOICE_E,
- active_sim_slot, 0, FALSE, TRUE);
- if (ret != 0) {
- err("_callmgr_core_process_dial() is failed[%d].", ret);
- goto SAT_SETUP_CALL_FAIL_EXIT;
- }
+ ret = _callmgr_core_process_dial(core_data, number, CALL_TYPE_VOICE_E,
+ active_sim_slot, 0, FALSE, TRUE);
+ if (ret != 0) {
+ err("_callmgr_core_process_dial() is failed[%d].", ret);
+ goto SAT_SETUP_CALL_FAIL_EXIT;
+ }
- // will send sat response when setup call is succesfull.
- return;
+ // will send sat response when setup call is succesfull.
+ return;
SAT_SETUP_CALL_FAIL_EXIT:
- _callmgr_telephony_send_sat_response(core_data->telephony_handle,
- CM_TELEPHONY_SAT_EVENT_SETUP_CALL, CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND, CM_TELEPHONY_SIM_UNKNOWN);
- return;
- }
- break;
- case CM_TELEPHONY_EVENT_SAT_SEND_DTMF:
- {
- cm_telephony_call_data_t *call = NULL;
- char *sat_dtmf_number = (char *)event_data;
-
- _callmgr_telephony_get_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_ACTIVE, &call);
- if (call == NULL) {
- err("No active call");
- goto SAT_SEND_DTMF_FAIL_EXIT;
- }
+ _callmgr_telephony_send_sat_response(core_data->telephony_handle,
+ CM_TELEPHONY_SAT_EVENT_SETUP_CALL, CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND, CM_TELEPHONY_SIM_UNKNOWN);
+ return;
+ }
+ break;
+ case CM_TELEPHONY_EVENT_SAT_SEND_DTMF:
+ {
+ cm_telephony_call_data_t *call = NULL;
+ char *sat_dtmf_number = (char *)event_data;
+
+ _callmgr_telephony_get_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_ACTIVE, &call);
+ if (call == NULL) {
+ err("No active call");
+ goto SAT_SEND_DTMF_FAIL_EXIT;
+ }
- _callmgr_telephony_set_dtmf_number(call, sat_dtmf_number);
- if (__callmgr_core_process_dtmf_number(core_data) != 0) {
- err("__callmgr_core_process_dtmf_number() is failed.");
- goto SAT_SEND_DTMF_FAIL_EXIT;
- }
+ _callmgr_telephony_set_dtmf_number(call, sat_dtmf_number);
+ if (__callmgr_core_process_dtmf_number(core_data) != 0) {
+ err("__callmgr_core_process_dtmf_number() is failed.");
+ goto SAT_SEND_DTMF_FAIL_EXIT;
+ }
- // will send sat response when dtmp processing is finished.
- return;
+ // will send sat response when dtmp processing is finished.
+ return;
SAT_SEND_DTMF_FAIL_EXIT:
- _callmgr_telephony_send_sat_response(core_data->telephony_handle,
- CM_TELEPHONY_SAT_EVENT_SEND_DTMF, CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND, CM_TELEPHONY_SIM_UNKNOWN);
- return;
- }
- break;
- case CM_TELEPHONY_EVENT_SAT_CALL_CONTROL_RESULT:
- {
- cm_telephony_sat_call_ctrl_type_e *call_ctrl_type = event_data;
+ _callmgr_telephony_send_sat_response(core_data->telephony_handle,
+ CM_TELEPHONY_SAT_EVENT_SEND_DTMF, CM_TELEPHONY_SAT_RESPONSE_ME_UNABLE_TO_PROCESS_COMMAND, CM_TELEPHONY_SIM_UNKNOWN);
+ return;
+ }
+ break;
+ case CM_TELEPHONY_EVENT_SAT_CALL_CONTROL_RESULT:
+ {
+ cm_telephony_sat_call_ctrl_type_e *call_ctrl_type = event_data;
- if (*call_ctrl_type == CM_TELEPHONY_SAT_CALL_CTRL_R_NOT_ALLOWED) {
- _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_NOT_ALLOWED, NULL, 0, NULL, NULL);
+ if (*call_ctrl_type == CM_TELEPHONY_SAT_CALL_CTRL_R_NOT_ALLOWED) {
+ _callmgr_util_launch_popup(CALL_POPUP_CALL_ERR, CALL_ERR_NOT_ALLOWED, NULL, 0, NULL, NULL);
- info("send TR with cause which call is not allowed by SAT call control.")
- _callmgr_telephony_send_sat_response(core_data->telephony_handle,
- CM_TELEPHONY_SAT_EVENT_SETUP_CALL, CM_TELEPHONY_SAT_RESPONSE_ME_CONTROL_PERMANENT_PROBLEM, CM_TELEPHONY_SIM_UNKNOWN);
- } else {
- if (*call_ctrl_type == CM_TELEPHONY_SAT_CALL_CTRL_R_ALLOWED_MOD) {
- char popup[128] = {0,};
- char *number = NULL;
- cm_telephony_call_data_t *call = NULL;
-
- _callmgr_telephony_get_sat_call_control_call(core_data->telephony_handle, &call);
- _callmgr_telephony_get_call_number(call, &number);
- if (number) {
- // display "Number changed by SIM: XXXX" with popup
- // according to SMC lab. requirement (P150909-00591)
- g_snprintf(popup, 127, "Number changed by SIM: %s", number);
- _callmgr_util_launch_popup(CALL_POPUP_TOAST, CALL_POPUP_TOAST_CUSTOM, popup, 0 , NULL, NULL);
-
- g_free(number);
- }
- }
- _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_CALL_CONTROL_E, 0, active_sim_slot, end_cause);
- }
- return;
- }
- break;
- case CM_TELEPHON_EVENT_DTMF_STOP_ACK:
- {
- cm_telephony_dtmf_result_e result = (cm_telephony_dtmf_result_e)event_data;
- cm_telephony_call_data_t *active_call = NULL;
+ info("send TR with cause which call is not allowed by SAT call control.")
+ _callmgr_telephony_send_sat_response(core_data->telephony_handle,
+ CM_TELEPHONY_SAT_EVENT_SETUP_CALL, CM_TELEPHONY_SAT_RESPONSE_ME_CONTROL_PERMANENT_PROBLEM, CM_TELEPHONY_SIM_UNKNOWN);
+ } else {
+ if (*call_ctrl_type == CM_TELEPHONY_SAT_CALL_CTRL_R_ALLOWED_MOD) {
+ char popup[128] = {0,};
+ char *number = NULL;
+ cm_telephony_call_data_t *call = NULL;
- _callmgr_telephony_get_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_ACTIVE, &active_call);
- CM_RETURN_IF_FAIL(active_call);
+ _callmgr_telephony_get_sat_call_control_call(core_data->telephony_handle, &call);
+ _callmgr_telephony_get_call_number(call, &number);
+ if (number) {
+ // display "Number changed by SIM: XXXX" with popup
+ // according to SMC lab. requirement (P150909-00591)
+ g_snprintf(popup, 127, "Number changed by SIM: %s", number);
+ _callmgr_util_launch_popup(CALL_POPUP_TOAST, CALL_POPUP_TOAST_CUSTOM, popup, 0 , NULL, NULL);
- if (result == CM_TEL_DTMF_SEND_SUCCESS) {
- __callmgr_core_process_dtmf_number(core_data);
- } else {
- _callmgr_telephony_set_dtmf_number(active_call, NULL);
- _callmgr_dbus_send_dtmf_indi(core_data, CALL_DTMF_INDI_IDLE_E, NULL);
+ g_free(number);
}
}
- break;
- case CM_TELEPHON_EVENT_DTMF_START_ACK:
- {
- cm_telephony_dtmf_result_e result = (cm_telephony_dtmf_result_e)event_data;
- cm_telephony_call_data_t *active_call = NULL;
+ _callmgr_dbus_send_call_event(core_data, CALL_MANAGER_CALL_EVENT_CALL_CONTROL_E, 0, active_sim_slot, end_cause);
+ }
+ return;
+ }
+ break;
+ case CM_TELEPHON_EVENT_DTMF_STOP_ACK:
+ {
+ cm_telephony_dtmf_result_e result = (cm_telephony_dtmf_result_e)event_data;
+ cm_telephony_call_data_t *active_call = NULL;
- _callmgr_telephony_get_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_ACTIVE, &active_call);
- CM_RETURN_IF_FAIL(active_call);
+ _callmgr_telephony_get_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_ACTIVE, &active_call);
+ CM_RETURN_IF_FAIL(active_call);
- if (result != CM_TEL_DTMF_SEND_SUCCESS) {
- _callmgr_telephony_set_dtmf_number(active_call, NULL);
- _callmgr_dbus_send_dtmf_indi(core_data, CALL_DTMF_INDI_IDLE_E, NULL);
- }
- }
- break;
- default:
- break;
+ if (result == CM_TEL_DTMF_SEND_SUCCESS) {
+ __callmgr_core_process_dtmf_number(core_data);
+ } else {
+ _callmgr_telephony_set_dtmf_number(active_call, NULL);
+ _callmgr_dbus_send_dtmf_indi(core_data, CALL_DTMF_INDI_IDLE_E, NULL);
+ }
+ }
+ break;
+ case CM_TELEPHON_EVENT_DTMF_START_ACK:
+ {
+ cm_telephony_dtmf_result_e result = (cm_telephony_dtmf_result_e)event_data;
+ cm_telephony_call_data_t *active_call = NULL;
+
+ _callmgr_telephony_get_call_by_state(core_data->telephony_handle, CM_TEL_CALL_STATE_ACTIVE, &active_call);
+ CM_RETURN_IF_FAIL(active_call);
+
+ if (result != CM_TEL_DTMF_SEND_SUCCESS) {
+ _callmgr_telephony_set_dtmf_number(active_call, NULL);
+ _callmgr_dbus_send_dtmf_indi(core_data, CALL_DTMF_INDI_IDLE_E, NULL);
+ }
+ }
+ break;
+ default:
+ break;
}
}
CM_RETURN_IF_FAIL(core_data);
info("audio event : %d", event_type);
switch (event_type) {
- case CM_AUDIO_EVENT_PATH_CHANGED_E:
- {
- callmgr_audio_device_e active_device = (callmgr_audio_device_e)event_data;
- callmgr_path_type_e route = CALL_AUDIO_PATH_NONE_E;
-
- _callmgr_core_get_audio_state(core_data, &route);
- _callmgr_dbus_send_audio_status(core_data, route);
- if (route != CALL_AUDIO_PATH_NONE_E) {
- __callmgr_core_set_telephony_audio_route(core_data, active_device);
- }
- }
- break;
- case CM_AUDIO_EVENT_EARJACK_CHANGED_E:
- {
- gboolean is_available = GPOINTER_TO_INT(event_data);
- info("Earjack state : %d", is_available);
- if (core_data->active_dial || core_data->held) {
- /*Change path only if outgoing call or connected call exists */
- callmgr_audio_route_e route = CALLMGR_AUDIO_ROUTE_NONE_E;
- dbg("Change path");
-
- _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
-
- if (is_available == TRUE) {
- _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_EARJACK_E);
+ case CM_AUDIO_EVENT_PATH_CHANGED_E:
+ {
+ callmgr_audio_device_e active_device = (callmgr_audio_device_e)event_data;
+ callmgr_path_type_e route = CALL_AUDIO_PATH_NONE_E;
+
+ _callmgr_core_get_audio_state(core_data, &route);
+ _callmgr_dbus_send_audio_status(core_data, route);
+ if (route != CALL_AUDIO_PATH_NONE_E) {
+ __callmgr_core_set_telephony_audio_route(core_data, active_device);
+ }
+ }
+ break;
+ case CM_AUDIO_EVENT_EARJACK_CHANGED_E:
+ {
+ gboolean is_available = GPOINTER_TO_INT(event_data);
+ info("Earjack state : %d", is_available);
+ if (core_data->active_dial || core_data->held) {
+ /*Change path only if outgoing call or connected call exists */
+ callmgr_audio_route_e route = CALLMGR_AUDIO_ROUTE_NONE_E;
+ dbg("Change path");
+
+ _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
+
+ if (is_available == TRUE) {
+ _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_EARJACK_E);
+ } else {
+ gboolean is_bt_connected = FALSE;
+ _callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_BT_E, &is_bt_connected);
+
+ if (is_bt_connected) {
+ _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_BT_E);
+ } else if (route != CALLMGR_AUDIO_ROUTE_SPEAKER_E) {
+ gboolean is_cradle_conn = FALSE;
+ _callmgr_vconf_is_cradle_status(&is_cradle_conn);
+
+ if (is_cradle_conn) {
+ info("Cradle is connected. Turn on SPK");
+ _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_SPEAKER_E);
} else {
- gboolean is_bt_connected = FALSE;
- _callmgr_audio_is_sound_device_available(core_data->audio_handle, CALLMGR_AUDIO_DEVICE_BT_E, &is_bt_connected);
-
- if (is_bt_connected) {
- _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_BT_E);
- } else if (route != CALLMGR_AUDIO_ROUTE_SPEAKER_E) {
- gboolean is_cradle_conn = FALSE;
- _callmgr_vconf_is_cradle_status(&is_cradle_conn);
-
- if (is_cradle_conn) {
- info("Cradle is connected. Turn on SPK");
- _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_SPEAKER_E);
- } else {
- __callmgr_core_set_default_audio_route(core_data);
- }
- }
+ __callmgr_core_set_default_audio_route(core_data);
}
}
- else if (core_data->incom) {
- }
}
+ } else if (core_data->incom) {
+ }
+ }
+ break;
+ case CM_AUDIO_EVENT_VOLUME_CHANGED_E:
+ {
+ int volume = GPOINTER_TO_INT(event_data);
+ callmgr_path_type_e route = CALL_AUDIO_PATH_NONE_E;
+ cm_telephony_audio_path_type_e telephony_type = CM_TAPI_SOUND_PATH_HANDSET;
+
+ _callmgr_core_get_audio_state(core_data, &route);
+ switch (route) {
+ case CALL_AUDIO_PATH_SPEAKER_E:
+ telephony_type = CM_TAPI_SOUND_PATH_SPK_PHONE;
break;
- case CM_AUDIO_EVENT_VOLUME_CHANGED_E:
- {
- int volume = GPOINTER_TO_INT(event_data);
- callmgr_path_type_e route = CALL_AUDIO_PATH_NONE_E;
- cm_telephony_audio_path_type_e telephony_type = CM_TAPI_SOUND_PATH_HANDSET;
-
- _callmgr_core_get_audio_state(core_data, &route);
- switch (route) {
- case CALL_AUDIO_PATH_SPEAKER_E:
- telephony_type = CM_TAPI_SOUND_PATH_SPK_PHONE;
- break;
- case CALL_AUDIO_PATH_EARJACK_E:
- telephony_type = CM_TAPI_SOUND_PATH_HEADSET;
- break;
- case CALL_AUDIO_PATH_BT_E:
- telephony_type = CM_TAPI_SOUND_PATH_BLUETOOTH;
- break;
- default:
- telephony_type = CM_TAPI_SOUND_PATH_HANDSET;
- break;
- }
- info("type : %d, vol : %d", telephony_type, volume);
-
- _callmgr_telephony_set_modem_volume(core_data->telephony_handle, telephony_type, volume);
- }
+ case CALL_AUDIO_PATH_EARJACK_E:
+ telephony_type = CM_TAPI_SOUND_PATH_HEADSET;
break;
- case CM_AUDIO_EVENT_BT_CHANGED_E:
- {
- int is_connected = GPOINTER_TO_INT(event_data);
- if (core_data->active_dial || core_data->held) {
- if (is_connected)
- _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_BT_E);
- else
- __callmgr_core_set_default_audio_route(core_data);
- } else {
- info("No active call. Ignore");
- }
- }
+ case CALL_AUDIO_PATH_BT_E:
+ telephony_type = CM_TAPI_SOUND_PATH_BLUETOOTH;
break;
default:
+ telephony_type = CM_TAPI_SOUND_PATH_HANDSET;
break;
+ }
+ info("type : %d, vol : %d", telephony_type, volume);
+
+ _callmgr_telephony_set_modem_volume(core_data->telephony_handle, telephony_type, volume);
+ }
+ break;
+ case CM_AUDIO_EVENT_BT_CHANGED_E:
+ {
+ int is_connected = GPOINTER_TO_INT(event_data);
+ if (core_data->active_dial || core_data->held) {
+ if (is_connected)
+ _callmgr_audio_set_audio_route(core_data->audio_handle, CALLMGR_AUDIO_ROUTE_BT_E);
+ else
+ __callmgr_core_set_default_audio_route(core_data);
+ } else {
+ info("No active call. Ignore");
+ }
+ }
+ break;
+ default:
+ break;
}
}
g_slist_free(call_list);
_callmgr_bt_send_call_list(core_data->bt_handle);
- }
- else {
+ } else {
err("Err");
}
}
info("bt event : %d", event_type);
switch (event_type) {
- case CM_BT_EVENT_CONNECTION_CHANGED_E:
- {
- is_connected = GPOINTER_TO_INT(event_data);
- if (is_connected) {
- int call_cnt = 0;
-
- _callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
- if (call_cnt == 1) {
- /* Send call list for init */
- __callmgr_core_send_bt_list(core_data, call_cnt);
- }
-
- /* Send init event */
- __callmgr_core_send_bt_events(core_data, 0);
- }
- else {
- callmgr_audio_route_e route = CALLMGR_AUDIO_ROUTE_NONE_E;
- _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
-
- if (route == CALLMGR_AUDIO_ROUTE_BT_E) {
- if (core_data->active_dial || core_data->held) {
- }
- else {
- info("No active call. Ignore");
- }
- }
- else {
- info("Not BT. ignore event");
- }
+ case CM_BT_EVENT_CONNECTION_CHANGED_E:
+ {
+ is_connected = GPOINTER_TO_INT(event_data);
+ if (is_connected) {
+ int call_cnt = 0;
- }
- /* Todo : Send event to UI*/
+ _callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
+ if (call_cnt == 1) {
+ /* Send call list for init */
+ __callmgr_core_send_bt_list(core_data, call_cnt);
}
- break;
- case CM_BT_EVENT_DTMF_TRANSMITTED_E:
- {
- dtmf_char = (char *)event_data;
- dbg("dtmf : %s", dtmf_char);
- if (core_data->active_dial) {
- _callmgr_telephony_start_dtmf(core_data->telephony_handle, dtmf_char[0]);
- _callmgr_telephony_stop_dtmf(core_data->telephony_handle);
- }
- else {
- info("No active call. Ignore");
- }
- }
- break;
- case CM_BT_EVENT_SPK_GAIN_CHANGED_E:
- {
- spk_gain = GPOINTER_TO_INT(event_data);
- dbg("spk gain : %d", spk_gain);
+ /* Send init event */
+ __callmgr_core_send_bt_events(core_data, 0);
+ } else {
+ callmgr_audio_route_e route = CALLMGR_AUDIO_ROUTE_NONE_E;
+ _callmgr_audio_get_audio_route(core_data->audio_handle, &route);
+ if (route == CALLMGR_AUDIO_ROUTE_BT_E) {
if (core_data->active_dial || core_data->held) {
- /* Todo: Send event to UI */
- }
- else {
+ } else {
info("No active call. Ignore");
}
+ } else {
+ info("Not BT. ignore event");
}
- break;
- case CM_BT_EVENT_CALL_HANDLE_ACCEPT_E:
- {
- gboolean is_bike_mode_enabled = FALSE;
- req_call_id = GPOINTER_TO_INT(event_data);
- dbg("req call id : %d", req_call_id);
-
- _callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
- if (is_bike_mode_enabled) {
- err("Bikemode enabled. Ignore this event");
- break;
- }
- if (core_data->incom) {
- _callmgr_core_process_answer_call(core_data, CM_TEL_CALL_ANSWER_TYPE_NORMAL);
- }
- else {
- info("No incom call. Ignore");
- }
- }
+ }
+ /* Todo : Send event to UI*/
+ }
+ break;
+ case CM_BT_EVENT_DTMF_TRANSMITTED_E:
+ {
+ dtmf_char = (char *)event_data;
+ dbg("dtmf : %s", dtmf_char);
+
+ if (core_data->active_dial) {
+ _callmgr_telephony_start_dtmf(core_data->telephony_handle, dtmf_char[0]);
+ _callmgr_telephony_stop_dtmf(core_data->telephony_handle);
+ } else {
+ info("No active call. Ignore");
+ }
+ }
+ break;
+ case CM_BT_EVENT_SPK_GAIN_CHANGED_E:
+ {
+ spk_gain = GPOINTER_TO_INT(event_data);
+ dbg("spk gain : %d", spk_gain);
+
+ if (core_data->active_dial || core_data->held) {
+ /* Todo: Send event to UI */
+ } else {
+ info("No active call. Ignore");
+ }
+ }
+ break;
+ case CM_BT_EVENT_CALL_HANDLE_ACCEPT_E:
+ {
+ gboolean is_bike_mode_enabled = FALSE;
+ req_call_id = GPOINTER_TO_INT(event_data);
+ dbg("req call id : %d", req_call_id);
+
+ _callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
+ if (is_bike_mode_enabled) {
+ err("Bikemode enabled. Ignore this event");
break;
+ }
- case CM_BT_EVENT_CALL_HANDLE_REJECT_E:
- {
- gboolean is_bike_mode_enabled = FALSE;
- req_call_id = GPOINTER_TO_INT(event_data);
- dbg("req call id : %d", req_call_id);
+ if (core_data->incom) {
+ _callmgr_core_process_answer_call(core_data, CM_TEL_CALL_ANSWER_TYPE_NORMAL);
+ } else {
+ info("No incom call. Ignore");
+ }
+ }
+ break;
- _callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
- if (is_bike_mode_enabled) {
- err("Bikemode enabled. Ignore this event");
- break;
- }
+ case CM_BT_EVENT_CALL_HANDLE_REJECT_E:
+ {
+ gboolean is_bike_mode_enabled = FALSE;
+ req_call_id = GPOINTER_TO_INT(event_data);
+ dbg("req call id : %d", req_call_id);
- if (core_data->incom) {
- _callmgr_core_process_reject_call(core_data);
- }
- else {
- info("No incom call. Ignore");
- }
- }
+ _callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
+ if (is_bike_mode_enabled) {
+ err("Bikemode enabled. Ignore this event");
break;
- case CM_BT_EVENT_CALL_HANDLE_RELEASE_E:
- {
- req_call_id = GPOINTER_TO_INT(event_data);
- dbg("req call id : %d", req_call_id);
+ }
- if (core_data->active_dial || core_data->held) {
- _callmgr_core_process_end_call(core_data, req_call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE);
- }
- else {
- info("No connect call. Ignore");
- }
- }
- break;
- case CM_BT_EVENT_CALL_HANDLE_0_SEND_E:
- {
- _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "0");
- }
- break;
- case CM_BT_EVENT_CALL_HANDLE_1_SEND_E:
- {
- _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "1");
- }
- break;
- case CM_BT_EVENT_CALL_HANDLE_2_SEND_E:
- {
- _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "2");
- }
- break;
- case CM_BT_EVENT_CALL_HANDLE_3_SEND_E:
- {
- _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "3");
- }
- break;
- case CM_BT_EVENT_CALL_HANDLE_4_SEND_E:
- {
- _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "4");
- }
- break;
+ if (core_data->incom) {
+ _callmgr_core_process_reject_call(core_data);
+ } else {
+ info("No incom call. Ignore");
+ }
+ }
+ break;
+ case CM_BT_EVENT_CALL_HANDLE_RELEASE_E:
+ {
+ req_call_id = GPOINTER_TO_INT(event_data);
+ dbg("req call id : %d", req_call_id);
- default:
- warn("Invalid event");
- break;
+ if (core_data->active_dial || core_data->held) {
+ _callmgr_core_process_end_call(core_data, req_call_id, CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE);
+ } else {
+ info("No connect call. Ignore");
+ }
+ }
+ break;
+ case CM_BT_EVENT_CALL_HANDLE_0_SEND_E:
+ {
+ _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "0");
+ }
+ break;
+ case CM_BT_EVENT_CALL_HANDLE_1_SEND_E:
+ {
+ _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "1");
+ }
+ break;
+ case CM_BT_EVENT_CALL_HANDLE_2_SEND_E:
+ {
+ _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "2");
+ }
+ break;
+ case CM_BT_EVENT_CALL_HANDLE_3_SEND_E:
+ {
+ _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "3");
+ }
+ break;
+ case CM_BT_EVENT_CALL_HANDLE_4_SEND_E:
+ {
+ _callmgr_telephony_process_incall_ss(core_data->telephony_handle, "4");
+ }
+ break;
+
+ default:
+ warn("Invalid event");
+ break;
}
}
static void __callmgr_core_process_vr_events(callmgr_vr_status_event_e status, callmgr_vr_status_extra_type_e extra_data, void *user_data)
CM_RETURN_IF_FAIL(core_data);
info("vr event : vr_status[%d], extra_data[0x%02x]", status, extra_data);
- switch(status) {
+ switch (status) {
case CALLMGR_VR_STATUS_EVENT_STARTED:
_callmgr_dbus_send_vr_status(core_data, status, extra_data);
break;
cm_util_rec_status_sub_info_e sub_info = CM_UTIL_REC_STATUS_NONE_E;
_callmgr_dbus_send_vr_status(core_data, status, extra_data);
- switch(extra_data) {
+ switch (extra_data) {
case CALLMGR_VR_STATUS_EXTRA_STOP_TYPE_BY_NO_FREE_SPACE:
sub_info = CM_UTIL_REC_STATUS_STOP_BY_MEMORY_FULL_E;
break;
CM_RETURN_IF_FAIL(core_data);
switch (event_type) {
- case CM_SENSOR_EVENT_TURN_OVER_E:
- {
- info("Detect turn over");
- __callmgr_core_stop_incom_noti(core_data);
- }
- break;
- default:
- warn("Invalid event");
- break;
+ case CM_SENSOR_EVENT_TURN_OVER_E:
+ {
+ info("Detect turn over");
+ __callmgr_core_stop_incom_noti(core_data);
+ }
+ break;
+ default:
+ warn("Invalid event");
+ break;
}
}
core_data = calloc(1, sizeof(callmgr_core_data_t));
CM_RETURN_VAL_IF_FAIL(core_data, -1);
- _callmgr_dbus_init (core_data);
+ _callmgr_dbus_init(core_data);
#ifdef TIZEN_SOUND_ROUTING_FEATURE
_callmgr_core_init_dbus_call_routing_status(core_data);
return FALSE;
}
- if(CALL_TYPE_VIDEO_E == call_type) {
+ if (CALL_TYPE_VIDEO_E == call_type) {
_callmgr_telephony_get_voice_call(core_data->telephony_handle, &call);
if (call) {
unsigned int call_id = NO_CALL_HANDLE;
err("Network mode: Out of service");
*reason = CALL_ERR_CAUSE_NOT_ALLOWED_E;
return FALSE;
- }
- else if (network_status == CM_NETWORK_STATUS_EMERGENCY_ONLY) {
+ } else if (network_status == CM_NETWORK_STATUS_EMERGENCY_ONLY) {
err("Network mode: Emergency only");
*reason = CALL_ERR_CAUSE_EMERGENCY_ONLY_E;
return FALSE;
- }
- else if(CALL_TYPE_VIDEO_E == call_type && network_status == CM_NETWORK_STATUS_IN_SERVICE_2G) {
+ } else if (CALL_TYPE_VIDEO_E == call_type && network_status == CM_NETWORK_STATUS_IN_SERVICE_2G) {
err("Network mode: 2G...Not sufficient for video call...");
*reason = CALL_ERR_CAUSE_NETWORK_2G_ONLY_E;
return FALSE;
cm_util_popup_result_e popup_result = (cm_util_popup_result_e)result;
if (popup_result == CM_UTIL_POPUP_RESP_CANCEL) {
_callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_FAIL_FLIGHT_MODE);
- }
- else {
+ } else {
info("OK button on FM popup is clicked ");
}
- }
- else if ((popup_type == CALL_POPUP_SIM_SELECT) || (popup_type == CALL_POPUP_OUT_OF_3G_TRY_VOICE_CALL)) {
+ } else if ((popup_type == CALL_POPUP_SIM_SELECT) || (popup_type == CALL_POPUP_OUT_OF_3G_TRY_VOICE_CALL)) {
cm_util_popup_result_e popup_result = (cm_util_popup_result_e)result;
if (popup_result == CM_UTIL_POPUP_RESP_CANCEL) {
_callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_CANCEL);
{
CM_RETURN_VAL_IF_FAIL(number, -1);
- switch(error_cause) {
+ switch (error_cause) {
case CALL_ERR_CAUSE_FLIGHT_MODE_E:
_callmgr_util_launch_popup(CALL_POPUP_FLIGHT_MODE, CALL_ERR_NONE, number, 0, NULL, NULL);
break;
_callmgr_telephony_get_preferred_sim_type(core_data->telephony_handle, &pref_sim_type);
if (pref_sim_type == CM_TEL_PREFERRED_SIM_1_E) {
preferred_slot = CM_TELEPHONY_SIM_1;
- }
- else if (pref_sim_type == CM_TEL_PREFERRED_SIM_2_E) {
+ } else if (pref_sim_type == CM_TEL_PREFERRED_SIM_2_E) {
preferred_slot = CM_TELEPHONY_SIM_2;
- }
- else {
+ } else {
if (!is_emergency_contact) {
_callmgr_util_launch_popup(CALL_POPUP_SIM_SELECT, call_type, number, 0, __callmgr_core_popup_result_cb, core_data);
return -2;
- }
- else {
+ } else {
preferred_slot = CM_TELEPHONY_SIM_1;
}
}
- }
- else if (sim_init_cnt == 1) {
+ } else if (sim_init_cnt == 1) {
if (is_sim1_initialized) {
preferred_slot = CM_TELEPHONY_SIM_1;
- }
- else {
+ } else {
preferred_slot = CM_TELEPHONY_SIM_2;
}
- }
- else {
+ } else {
err("SIM not initialized!!");
preferred_slot = CM_TELEPHONY_SIM_1;
}
cm_telepony_sim_slot_type_e alternative_slot = CM_TELEPHONY_SIM_UNKNOWN;
if (preferred_slot == CM_TELEPHONY_SIM_1) {
alternative_slot = CM_TELEPHONY_SIM_2;
- }
- else {
+ } else {
alternative_slot = CM_TELEPHONY_SIM_1;
}
CM_RETURN_VAL_IF_FAIL(core_data, -1);
_callmgr_util_extract_call_number(number, &extracted_call_num, &extracted_dtmf_num);
- _callmgr_telephony_check_ecc_number(core_data->telephony_handle, extracted_call_num, &is_emergency_call,&ecc_category);
+ _callmgr_telephony_check_ecc_number(core_data->telephony_handle, extracted_call_num, &is_emergency_call, &ecc_category);
CM_SAFE_FREE(extracted_call_num);
CM_SAFE_FREE(extracted_dtmf_num);
_callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_SUCCESS);
return 0;
}
- }
- else {
+ } else {
if (!is_emergency_call) {
/*Set active SIM slot to support multi SIM*/
if (sim_slot == CALL_MANAGER_SIM_SLOT_DEFAULT_E) {
ret = __callmgr_core_select_sim_slot(core_data, number, call_type, is_emergency_contact);
- if (ret ==-2) { // this means we request to launch SIM selection popup, so just return 0(SUCCESS).
+ if (ret == -2) { // this means we request to launch SIM selection popup, so just return 0(SUCCESS).
return 0;
}
- }
- else {
+ } else {
if (sim_slot == CALL_MANAGER_SIM_SLOT_1_E) {
_callmgr_telephony_set_active_sim_slot(core_data->telephony_handle, CM_TELEPHONY_SIM_1);
- }
- else if (sim_slot == CALL_MANAGER_SIM_SLOT_2_E) {
+ } else if (sim_slot == CALL_MANAGER_SIM_SLOT_2_E) {
_callmgr_telephony_set_active_sim_slot(core_data->telephony_handle, CM_TELEPHONY_SIM_2);
- }
- else {
+ } else {
err("unhandled sim slot[%d]", sim_slot);
}
}
_callmgr_dbus_send_dial_status(core_data, CALL_MANAGER_DIAL_FAIL_FLIGHT_MODE);
return -1;
}
- }
- else {
+ } else {
_callmgr_util_launch_popup(CALL_POPUP_FLIGHT_MODE, call_type, number, active_sim, __callmgr_core_popup_result_cb, core_data);
return 0;
}
- }
- else if (err_cause == CALL_ERR_CAUSE_NETWORK_2G_ONLY_E) {
+ } else if (err_cause == CALL_ERR_CAUSE_NETWORK_2G_ONLY_E) {
_callmgr_util_launch_popup(CALL_POPUP_OUT_OF_3G_TRY_VOICE_CALL, CALL_TYPE_VOICE_E, number, active_sim, __callmgr_core_popup_result_cb, core_data);
return 0;
- }
- else {
+ } else {
err("Couldn't make a call.");
__callmgr_core_launch_error_popup(err_cause, number);
return -1; // TODO: return proper error cause
ret = _callmgr_telephony_call_new(core_data->telephony_handle, CM_TEL_CALL_TYPE_E911,
CM_TEL_CALL_DIRECTION_MO, number_after_removal, &call);
_callmgr_telephony_set_ecc_category(call, ecc_category);
- }
- else {
+ } else {
/*ToDo: Should know the CallDomain and decide on the Call as per domain*/
if (call_type == CALL_TYPE_VIDEO_E) {
warn("Adding new call data...");
CM_RETURN_VAL_IF_FAIL(core_data, -1);
switch (release_type) {
- case CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE:
- break;
- case CM_TEL_CALL_RELEASE_TYPE_ALL_CALLS:
- if (core_data->active_dial) {
- call_id = core_data->active_dial->call_id;
- }
- else if (core_data->held) {
- call_id = core_data->held->call_id;
- }
- else if (core_data->incom) {
- call_id = core_data->incom->call_id;
- }
- break;
- case CM_TEL_CALL_RELEASE_TYPE_ALL_HOLD_CALLS:
- if (core_data->held) {
- call_id = core_data->held->call_id;
- }
- break;
- case CM_TEL_CALL_RELEASE_TYPE_ALL_ACTIVE_CALLS:
- if (core_data->active_dial) {
- call_id = core_data->active_dial->call_id;
- }
- break;
- default:
- err("wrong release_type")
- return -1;
+ case CM_TEL_CALL_RELEASE_TYPE_BY_CALL_HANDLE:
+ break;
+ case CM_TEL_CALL_RELEASE_TYPE_ALL_CALLS:
+ if (core_data->active_dial) {
+ call_id = core_data->active_dial->call_id;
+ } else if (core_data->held) {
+ call_id = core_data->held->call_id;
+ } else if (core_data->incom) {
+ call_id = core_data->incom->call_id;
+ }
+ break;
+ case CM_TEL_CALL_RELEASE_TYPE_ALL_HOLD_CALLS:
+ if (core_data->held) {
+ call_id = core_data->held->call_id;
+ }
+ break;
+ case CM_TEL_CALL_RELEASE_TYPE_ALL_ACTIVE_CALLS:
+ if (core_data->active_dial) {
+ call_id = core_data->active_dial->call_id;
+ }
+ break;
+ default:
+ err("wrong release_type")
+ return -1;
}
ret = _callmgr_telephony_end_call(core_data->telephony_handle, call_id, release_type);
__callmgr_core_cancel_auto_answer(core_data);
- if (core_data->incom){
+ if (core_data->incom) {
/* Reject incoming call */
info("Reject incoming call");
__callmgr_core_stop_incom_noti(core_data);
return -1;
}
_callmgr_ct_set_log_reject_type(core_data->incom->call_id, CM_CT_PLOG_REJECT_TYPE_NORMAL_E);
- }
- else{
+ } else{
err("incom call data is NULL");
return -1;
}
dbg("The name gotten for callmgr_vr is [%s],", call_name);
ret = _callmgr_vr_start_record(core_data->vr_handle, call_num, call_name, is_answering_message);
g_free(call_name);
- if(ret < 0) {
+ if (ret < 0) {
err("_callmgr_vr_start_record() failed");
return -1;
}
dbg(">>");
ret = _callmgr_vr_stop_record(core_data->vr_handle);
- if(ret < 0) {
+ if (ret < 0) {
err("_callmgr_vr_stop_record() failed");
return -1;
}
int _callmgr_core_process_set_mute_state(callmgr_core_data_t *core_data, gboolean is_mute_state)
{
cm_telephony_call_data_t *active_call = NULL;
- cm_telephony_call_type_e call_type =CM_TEL_CALL_TYPE_INVALID ;
+ cm_telephony_call_type_e call_type = CM_TEL_CALL_TYPE_INVALID ;
callmgr_call_type_e cm_call_type = CALL_TYPE_INVALID_E;
dbg(">>");
CM_RETURN_VAL_IF_FAIL(core_data, -1);
__callmgr_core_convert_tel_call_type(call_type, &cm_call_type);
if (cm_call_type == CALL_TYPE_VOICE_E) {
- if (_callmgr_audio_set_audio_tx_mute(core_data->audio_handle, is_mute_state) < 0 ) {
+ if (_callmgr_audio_set_audio_tx_mute(core_data->audio_handle, is_mute_state) < 0) {
err("_callmgr_audio_set_audio_tx_mute() failed");
return -1;
}
if (resp_type == CALL_DTMF_RESP_CONTINUE_E) {
__callmgr_core_process_dtmf_number(core_data);
- }
- else { //CALL_DTMF_RESP_CANCEL_E
+ } else { //CALL_DTMF_RESP_CANCEL_E
_callmgr_telephony_set_dtmf_number(active_call, NULL);
}
err = _callmgr_core_process_dial(core_data, number, call_type, sim_slot, disable_fm, is_emergency_contact, FALSE);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_end_call(core_data, (unsigned int)call_id, (int)release_type);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_reject_call(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_swap_call(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_hold_call(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_unhold_call(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_join_call(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_split_call(core_data, (unsigned int)call_id);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_transfer_call(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_answer_call(core_data, (int)ans_type);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_spk_on(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_spk_off(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_bluetooth_on(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_bluetooth_off(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_set_extra_vol(core_data, (int)is_extra_vol);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_set_noise_reduction(core_data, is_noise_reduction);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_set_mute_state(core_data, (int)is_mute_state);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
int person_id = -1;
ret = _callmgr_telephony_get_call_list(core_data->telephony_handle, &call_list);
- if(-1 == ret || !call_list) {
+ if (-1 == ret || !call_list) {
err("callmgr_telephony_get_call_list() failed");
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(aa{sv})", NULL));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(aa{sv})", NULL));
return -1;
}
while (call_list) {
call_obj = (cm_telephony_call_data_t*)call_list->data;
- if ( !call_obj ) {
+ if (!call_obj) {
dbg("[ error ] call object : 0");
call_list = call_list->next;
continue;
call_list_gv = g_variant_builder_end(&b);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(@aa{sv})", call_list_gv));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(@aa{sv})", call_list_gv));
return TRUE;
}
cm_telephony_name_mode_e name_mode = CM_TEL_NAME_MODE_NONE;
ret = _callmgr_telephony_get_call_list(core_data->telephony_handle, &call_list);
- if(-1 == ret || !call_list) {
+ if (-1 == ret || !call_list) {
err("callmgr_telephony_get_call_list() failed");
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(aa{sv})", NULL));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(aa{sv})", NULL));
return -1;
}
while (call_list) {
call_obj = (cm_telephony_call_data_t*)call_list->data;
- if ( !call_obj ) {
+ if (!call_obj) {
dbg("[ error ] call object : 0");
call_list = g_slist_next(call_list);
continue;
if (call_number) {
g_variant_builder_add(&b, "{sv}", "call_number", g_variant_new_string(call_number));
g_free(call_number);
- }
- else {
+ } else {
g_variant_builder_add(&b, "{sv}", "call_number", NULL);
}
g_variant_builder_add(&b, "{sv}", "person_id", g_variant_new_uint32(person_id));
call_list_gv = g_variant_builder_end(&b);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(@aa{sv})", call_list_gv));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(@aa{sv})", call_list_gv));
return TRUE;
}
if (core_data->incom) {
__callmgr_dbus_get_gv_from_call_data(core_data, core_data->incom, &incom_gv);
} else {
- incom_gv = g_variant_new ("a{sv}", NULL);
+ incom_gv = g_variant_new("a{sv}", NULL);
}
if (core_data->active_dial) {
__callmgr_dbus_get_gv_from_call_data(core_data, core_data->active_dial, &active_dial_gv);
} else {
- active_dial_gv = g_variant_new ("a{sv}", NULL);
+ active_dial_gv = g_variant_new("a{sv}", NULL);
}
if (core_data->held) {
__callmgr_dbus_get_gv_from_call_data(core_data, core_data->held, &held_gv);
} else {
- held_gv = g_variant_new ("a{sv}", NULL);
+ held_gv = g_variant_new("a{sv}", NULL);
}
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new("(@a{sv}@a{sv}@a{sv})", incom_gv, active_dial_gv, held_gv));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(@a{sv}@a{sv}@a{sv})", incom_gv, active_dial_gv, held_gv));
return TRUE;
}
ret = _callmgr_core_process_dtmf_resp(core_data, resp);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", ret));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", ret));
return TRUE;
}
_callmgr_core_get_audio_state(core_data, &audio_state);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", audio_state));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", audio_state));
return TRUE;
}
err = _callmgr_core_process_stop_alert(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
err = _callmgr_core_process_start_alert(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
_callmgr_dbus_send_go_foreground_indi(core_data);
/*out*/
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", err));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", err));
return TRUE;
}
int mute_state = -1;
mute_state = core_data->is_mute_on;
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(i)", mute_state));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", mute_state));
return TRUE;
}
/*out*/
if (core_data->call_status == CALL_MANAGER_CALL_STATUS_RINGING_E) {
call_type = core_data->incom->call_type;
- }
- else if (core_data->call_status == CALL_MANAGER_CALL_STATUS_OFFHOOK_E) {
+ } else if (core_data->call_status == CALL_MANAGER_CALL_STATUS_OFFHOOK_E) {
if (core_data->active_dial) {
call_type = core_data->active_dial->call_type;
- }
- else if (core_data->held) {
+ } else if (core_data->held) {
call_type = core_data->held->call_type;
- }
- else {
+ } else {
err("No call data. Invalid call state");
}
}
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(ii)", core_data->call_status, call_type));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(ii)", core_data->call_status, call_type));
return TRUE;
}
-static void __on_name_appeared (GDBusConnection *connection,
- const gchar *name,
- const gchar *name_owner,
- gpointer user_data)
+static void __on_name_appeared(GDBusConnection *connection,
+ const gchar *name,
+ const gchar *name_owner,
+ gpointer user_data)
{
callmgr_core_data_t *core_data = user_data;
int i = 0;
int list_len = 0;
callmgr_watch_client_data_t *tmp = NULL;
list_len = g_slist_length(core_data->watch_list);
- for(i = 0; i < list_len; i++){
+ for (i = 0; i < list_len; i++) {
tmp = (callmgr_watch_client_data_t *)g_slist_nth_data(core_data->watch_list, i);
- if(0 == g_strcmp0(name, tmp->appid)){
+ if (0 == g_strcmp0(name, tmp->appid)) {
tmp->is_appeared = TRUE;
break;
}
dbg("appid [%s] appears and client num = %d", name, list_len);
}
-static void __on_name_vanished (GDBusConnection *connection,
- const gchar *name,
- gpointer user_data)
+static void __on_name_vanished(GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
{
int i = 0;
int list_len = 0;
callmgr_core_data_t *core_data = user_data;
dbg("..");
list_len = g_slist_length(core_data->watch_list);
- for(i = 0; i < list_len; i++){
+ for (i = 0; i < list_len; i++) {
tmp = (callmgr_watch_client_data_t *)g_slist_nth_data(core_data->watch_list, i);
/*__on_name_vanished will be invoked as soon as g_bus_watch_name is called, ignore it before __on_name_appeared invoked*/
- if(0 == g_strcmp0(name, tmp->appid) && TRUE == tmp->is_appeared){
- g_bus_unwatch_name( tmp->watch_id);
+ if (0 == g_strcmp0(name, tmp->appid) && TRUE == tmp->is_appeared) {
+ g_bus_unwatch_name(tmp->watch_id);
core_data->watch_list = g_slist_remove(core_data->watch_list, tmp);
info("appid [%s] exits , stop watching it, now client num = %d ", tmp->appid, g_slist_length(core_data->watch_list));
g_free(tmp->appid);
}
}
- if (NULL == core_data->watch_list){
+ if (NULL == core_data->watch_list) {
warn("end all calls");
_callmgr_core_process_end_call(core_data, 0, CM_TEL_CALL_RELEASE_TYPE_ALL_CALLS);
}
CM_RETURN_VAL_IF_FAIL(appid, FALSE);
list_len = g_slist_length(core_data->watch_list);
- for(i = 0; i < list_len; i++){
+ for (i = 0; i < list_len; i++) {
tmp = (callmgr_watch_client_data_t *)g_slist_nth_data(core_data->watch_list, i);
- if (0 == g_strcmp0(appid, tmp->appid) ){
+ if (0 == g_strcmp0(appid, tmp->appid)) {
dbg("appid[%s] is already being watched now", appid);
is_appid_watched = TRUE;
break;
}
}
- if(FALSE == is_appid_watched){
+ if (FALSE == is_appid_watched) {
dbg(" __set_watch_name[%s]", appid);
tmp = (callmgr_watch_client_data_t *)calloc(1, sizeof(callmgr_watch_client_data_t));
CM_RETURN_VAL_IF_FAIL(tmp, FALSE);
/*__on_name_vanished will be invoked as soon as g_bus_watch_name is called, ignore it before __on_name_appeared invoked*/
tmp->is_appeared = FALSE;
- tmp->watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM ,
+ tmp->watch_id = g_bus_watch_name(G_BUS_TYPE_SYSTEM ,
appid,
G_BUS_NAME_WATCHER_FLAGS_NONE ,
__on_name_appeared,
__on_name_vanished,
core_data,
NULL);
- if (tmp->watch_id == 0){
+ if (tmp->watch_id == 0) {
g_free(tmp);
err = -1;
- }
- else{
+ } else{
tmp->appid = g_strdup(appid);
core_data->watch_list = g_slist_append(core_data->watch_list, tmp);
}
} else {
is_answering_machine_on = FALSE;
}
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(b)", is_answering_machine_on));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(b)", is_answering_machine_on));
return TRUE;
}
gboolean is_video_recording = FALSE;
is_video_recording = core_data->is_video_recording;
- g_dbus_method_invocation_return_value (invoc, g_variant_new ("(b)", is_video_recording));
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(b)", is_video_recording));
return TRUE;
}
/********************************************/
-static gchar *__callmgr_dbus_convert_name_to_path (const gchar *name)
+static gchar *__callmgr_dbus_convert_name_to_path(const gchar *name)
{
int len;
int i;
if (!name)
return NULL;
- len = strlen (name);
+ len = strlen(name);
/* test-name -> test_2D_name */
- buf = g_malloc0 (len * 4);
+ buf = g_malloc0(len * 4);
if (!buf)
return NULL;
for (i = 0; i < len; i++) {
- if (g_ascii_isalnum (name[i]) || name[i] == '_' || name[i] == '/') {
+ if (g_ascii_isalnum(name[i]) || name[i] == '_' || name[i] == '/') {
buf[j] = name[i];
j++;
- }
- else {
- snprintf (hex, 3, "%02X", name[i]);
+ } else {
+ snprintf(hex, 3, "%02X", name[i]);
buf[j++] = '_';
buf[j++] = hex[0];
buf[j++] = hex[1];
}
-static int __callmgr_dbus_object_export (callmgr_core_data_t *core_data, GDBusInterfaceSkeleton *di, const gchar *path)
+static int __callmgr_dbus_object_export(callmgr_core_data_t *core_data, GDBusInterfaceSkeleton *di, const gchar *path)
{
GError *error = NULL;
gboolean ret;
if (!di || !path)
return -1;
- real_path = __callmgr_dbus_convert_name_to_path (path);
+ real_path = __callmgr_dbus_convert_name_to_path(path);
- if (g_variant_is_object_path (real_path) == FALSE) {
- err( "invalid name('%s'). (must only contain [A-Z][a-z][0-9]_)", real_path);
- g_free (real_path);
+ if (g_variant_is_object_path(real_path) == FALSE) {
+ err("invalid name('%s'). (must only contain [A-Z][a-z][0-9]_)", real_path);
+ g_free(real_path);
return -1;
}
- ret = g_dbus_interface_skeleton_export (di, core_data->dbus_conn, real_path, &error);
+ ret = g_dbus_interface_skeleton_export(di, core_data->dbus_conn, real_path, &error);
if (ret == FALSE) {
if (error) {
err("error: %s", error->message);
- g_error_free (error);
- }
- else {
+ g_error_free(error);
+ } else {
err("export failed");
}
- g_free (real_path);
+ g_free(real_path);
return -1;
}
- g_free (real_path);
+ g_free(real_path);
return 0;
}
-static int __callmgr_dbus_init_handlers (callmgr_core_data_t *core_data)
+static int __callmgr_dbus_init_handlers(callmgr_core_data_t *core_data)
{
GDBusInterfaceSkeleton *di;
CM_RETURN_VAL_IF_FAIL(core_data, -1);
- di = G_DBUS_INTERFACE_SKELETON (callmgr_org_tizen_callmgr_skeleton_new ());
+ di = G_DBUS_INTERFACE_SKELETON(callmgr_org_tizen_callmgr_skeleton_new());
/*handlers*/
g_signal_connect(di, "handle-dial-call", G_CALLBACK(__dial_call_handler), core_data);
// TODO:
// need to add prefix
-static void __on_bus_acquired (GDBusConnection *conn, const gchar *name,
+static void __on_bus_acquired(GDBusConnection *conn, const gchar *name,
gpointer user_data)
{
callmgr_core_data_t *core_data = (callmgr_core_data_t *)user_data;
dbg("acquired");
__callmgr_dbus_init_handlers(core_data);
- g_dbus_object_manager_server_set_connection (core_data->gdoms, conn);
+ g_dbus_object_manager_server_set_connection(core_data->gdoms, conn);
}
-int _callmgr_dbus_init (callmgr_core_data_t *core_data)
+int _callmgr_dbus_init(callmgr_core_data_t *core_data)
{
CM_RETURN_VAL_IF_FAIL(core_data, -1);
guint id;
- core_data->gdoms = g_dbus_object_manager_server_new (CALLMGR_DBUS_PATH);
+ core_data->gdoms = g_dbus_object_manager_server_new(CALLMGR_DBUS_PATH);
if (!core_data->gdoms)
return -1;
- id = g_bus_own_name (G_BUS_TYPE_SYSTEM, CALLMGR_DBUS_SERVICE,
+ id = g_bus_own_name(G_BUS_TYPE_SYSTEM, CALLMGR_DBUS_SERVICE,
G_BUS_NAME_OWNER_FLAGS_REPLACE, __on_bus_acquired, NULL, NULL,
- core_data, NULL );
+ core_data, NULL);
if (id == 0) {
err("g_bus_own_name() failed");
return -1;
g_variant_builder_add(&b, "{sv}", "call_type", g_variant_new_int32(call_data->call_type));
g_variant_builder_add(&b, "{sv}", "call_state", g_variant_new_int32(call_data->call_state));
if (call_data->is_conference) {
- _callmgr_telephony_get_conference_call_count(core_data->telephony_handle, &call_member_cnt );
- }
- else { // Single call
+ _callmgr_telephony_get_conference_call_count(core_data->telephony_handle, &call_member_cnt);
+ } else { // Single call
call_member_cnt = 1;
}
g_variant_builder_add(&b, "{sv}", "member_count", g_variant_new_int32(call_member_cnt));
if (core_data->incom) {
__callmgr_dbus_get_gv_from_call_data(core_data, core_data->incom, &incom_gv);
} else {
- incom_gv = g_variant_new ("a{sv}", NULL);
+ incom_gv = g_variant_new("a{sv}", NULL);
}
if (core_data->active_dial) {
__callmgr_dbus_get_gv_from_call_data(core_data, core_data->active_dial, &active_dial_gv);
} else {
- active_dial_gv = g_variant_new ("a{sv}", NULL);
+ active_dial_gv = g_variant_new("a{sv}", NULL);
}
if (core_data->held) {
__callmgr_dbus_get_gv_from_call_data(core_data, core_data->held, &held_gv);
} else {
- held_gv = g_variant_new ("a{sv}", NULL);
+ held_gv = g_variant_new("a{sv}", NULL);
}
- g_signal_emit_by_name (core_data->dbus_skeleton_interface, "call-event", call_event, call_id, (int)sim_slot, (int)end_cause, incom_gv, active_dial_gv, held_gv);
+ g_signal_emit_by_name(core_data->dbus_skeleton_interface, "call-event", call_event, call_id, (int)sim_slot, (int)end_cause, incom_gv, active_dial_gv, held_gv);
return 0;
}
{
CM_RETURN_VAL_IF_FAIL(core_data, -1);
- g_signal_emit_by_name (core_data->dbus_skeleton_interface, "call-status", call_status, call_type, call_num);
+ g_signal_emit_by_name(core_data->dbus_skeleton_interface, "call-status", call_status, call_type, call_num);
return 0;
}
{
CM_RETURN_VAL_IF_FAIL(core_data, -1);
- g_signal_emit_by_name (core_data->dbus_skeleton_interface, "mute-status", mute_status);
+ g_signal_emit_by_name(core_data->dbus_skeleton_interface, "mute-status", mute_status);
return 0;
}
int _callmgr_dbus_send_dial_status(callmgr_core_data_t *core_data, callmgr_dial_status_e dial_status)
{
CM_RETURN_VAL_IF_FAIL(core_data, -1);
- g_signal_emit_by_name (core_data->dbus_skeleton_interface, "dial-status", dial_status);
+ g_signal_emit_by_name(core_data->dbus_skeleton_interface, "dial-status", dial_status);
return 0;
}
return -1;
}
- g_signal_emit_by_name (core_data->dbus_skeleton_interface, "dtmf-indi", indi_type, dtmf_number);
+ g_signal_emit_by_name(core_data->dbus_skeleton_interface, "dtmf-indi", indi_type, dtmf_number);
return 0;
}
int _callmgr_dbus_send_audio_status(callmgr_core_data_t *core_data, callmgr_path_type_e audio_path)
{
CM_RETURN_VAL_IF_FAIL(core_data, -1);
- g_signal_emit_by_name (core_data->dbus_skeleton_interface, "audio-state", audio_path);
+ g_signal_emit_by_name(core_data->dbus_skeleton_interface, "audio-state", audio_path);
return 0;
}
{
CM_RETURN_VAL_IF_FAIL(core_data, -1);
- g_signal_emit_by_name (core_data->dbus_skeleton_interface, "go-foreground");
+ g_signal_emit_by_name(core_data->dbus_skeleton_interface, "go-foreground");
return 0;
}
{
CM_RETURN_VAL_IF_FAIL(core_data, -1);
- g_signal_emit_by_name (core_data->dbus_skeleton_interface, "voice-record-status", vr_status, extra_type);
+ g_signal_emit_by_name(core_data->dbus_skeleton_interface, "voice-record-status", vr_status, extra_type);
return 0;
}