__BEGIN_DECLS
#define MAX_CALL_NUMBER_LEN 83
-#define MAX_CALL_NAME_LEN 83
+#define MAX_CALL_NAME_LEN 97
#define MAX_HANDLE 0xFF
#define MIN_HANDLE 0x01
#define INVALID_HANDLE 0x0
+#define INVALID_ID -1
+
enum tcore_call_type {
TCORE_CALL_TYPE_VOICE,
TCORE_CALL_TYPE_VIDEO,
TReturn (*confirm_upgrade)(CoreObject *o, UserRequest *ur); /* IMS specific */
TReturn (*start_conference)(CoreObject *o, UserRequest *ur);
TReturn (*modify_participants_in_conference)(CoreObject *o, UserRequest *ur);
- TReturn (*set_ecc_status)(CoreObject* o, UserRequest* ur);
+ TReturn (*set_ecc_status)(CoreObject *o, UserRequest *ur);
};
struct tcore_call_information_operations {
gboolean tcore_sim_decode_cff(struct tel_sim_cphs_cf *cfis, unsigned char *p_in, int in_length);
char *tcore_sim_encode_cff(const struct tel_sim_cphs_cf *cff, int in_length);
gboolean tcore_sim_decode_csp(struct tel_sim_cphs_csp *p_csp, unsigned char *p_in, int in_length);
-#if 0
-gboolean tcore_sim_encode_csp(unsigned char *p_out, int out_length, struct tel_sim_cphs_csp *p_csp);
-#endif
gboolean tcore_sim_decode_dynamic_flag(struct tel_sim_cphs_dflag *p_df, unsigned char *p_in, int in_length);
gboolean tcore_sim_encode_dynamic_flag(char *p_out, int out_length, struct tel_sim_cphs_dflag *p_df);
gboolean tcore_sim_decode_dynamic2_flag(struct tel_sim_cphs_dflag2 *p_d2f, unsigned char *p_in, int in_length);
#include <glib.h>
enum telephony_call_error {
- CALL_ERROR_NONE, /**< Success */
- CALL_ERROR_ACCESSDISCARD, /**< Access discarded */
+ CALL_ERROR_NONE, /**< Success */
+ CALL_ERROR_ACCESSDISCARD, /**< Access discarded */
CALL_ERROR_BARR_BYOPERATOR, /**< Barred by operator */
CALL_ERROR_BEARERMODE_NOTIMPL, /**< Bearer mode not implemented */
CALL_ERROR_BEARERMODE_RESTRICTED, /**< Bearer mode restricted */
CALL_ERROR_BUSY, /**< (Network/Server) busy */
CALL_ERROR_CALLMETER_EXPIRED, /**< Call meter expired */
CALL_ERROR_CALLNO_ERROR, /**< Call number error */
- CALL_ERROR_CKTUNAVAIL, /**< Circuit channel unavailable */ //10
+ CALL_ERROR_CKTUNAVAIL, /**< Circuit channel unavailable */ //10
CALL_ERROR_CONGESTION, /**< Congestion happened */
CALL_ERROR_NO_CIRCUIT_AVAIL, /**< Circuit not available */
CALL_ERROR_DESTIN_INCOMPAT, /**< Destination incompatibility */
CALL_ERROR_FACILITY_NOTSUBSCRIBED, /**< Facility not subscribed */
CALL_ERROR_INCOMINGCUGCALLS_BARRED, /**< Incoming CUG Calls barred */
CALL_ERROR_INVALNUM, /**< Invalid number */
- CALL_ERROR_MPTY_ERROR, /**< Multiparty error */ //20
- CALL_ERROR_NOANSWER, /**< No answer */
+ CALL_ERROR_MPTY_ERROR, /**< Multiparty error */ //20
+ CALL_ERROR_NOANSWER, /**< No answer */
CALL_ERROR_NONCUGMEMBER, /**< Non CUG member */
CALL_ERROR_NUMBERCHANGED, /**< Number changed */
CALL_ERROR_NUMBER_ERROR, /**< Number error */
CALL_ERROR_OUTOFORDER, /**< Out of order */
CALL_ERROR_PROTOCOL_ERROR, /**< Protocol error */
CALL_ERROR_QOSUNAVAIL, /**< QOS unavailable */
- CALL_ERROR_REJECT, /**< Rejected */ //30
+ CALL_ERROR_REJECT, /**< Rejected */ //30
CALL_ERROR_REJ_FAIL, /**< Rejection failed */
CALL_ERROR_REJ_SRVC_NOT_AVL, /**< Rejection service not available */
CALL_ERROR_REJ_SAT_CALL_CTRL, /**< Rejection by SAT call control */
CALL_ERROR_SERVICE_NOTIMPL, /**< Service not implemented */
CALL_ERROR_SERVICE_UNAVAIL, /**< Service not available */
CALL_ERROR_MODIFY_SAME_BEARER, /**< Modify same bearer */
- CALL_ERROR_MODIFY_NOT_PERMITTED, /**< Modification not permitted */ //40
+ CALL_ERROR_MODIFY_NOT_PERMITTED, /**< Modification not permitted */ //40
CALL_ERROR_HOLD_FAIL, /**< Call hold fail */
CALL_ERROR_TEMPFAILURE, /**< Temporary failure */
CALL_ERROR_WRONGNUM, /**< Wrong number */
CALL_ERROR_SSINCOMPATIBLESTATE, /**< SS incompatible state */
CALL_ERROR_SSERRSYNTAXERROR, /**< SS syntax error */
CALL_ERROR_SSPROTOCOLERROR, /**< Protocol error */
- CALL_ERROR_SSNEGATIVEPASSWORDCHECK, /**< Negative password check */ //50
+ CALL_ERROR_SSNEGATIVEPASSWORDCHECK, /**< Negative password check */ //50
CALL_ERROR_SSSENTASPHASE1, /**< SS sent as phase1 message */
CALL_ERROR_SSERROR, /**< Supplementary service error */
CALL_ERROR_SS_USSD_BUSY, /**< Second USSD request will be rejected when already USSD transaction is ongoing. */
CALL_ERROR_UNKNOWN, /**< unknown no details available */
CALL_ERROR_INCOM_CALL, /**< terminated by incoming call */
CALL_ERROR_ALERT_STOP, /**< terminated by alert stop */
- CALL_ERROR_INTERCEPT, /**< voice call was dropped by interception */ //60
+ CALL_ERROR_INTERCEPT, /**< voice call was dropped by interception */ //60
CALL_ERROR_REORDER, /**< voice call was dropped by reordering */
CALL_ERROR_CLIENT_END, /**< client ended the call */
CALL_ERROR_ACCESS_CLASS_BLOCKED, /**< access class blocked */
CALL_ERROR_PROTOCOLID_ERROR, /**< Protocol id error */
CALL_ERROR_CLASSNOTSUPPORTED, /**< Class not supported */
CALL_ERROR_DATACODING_ERROR, /**< Data coding error */
- CALL_ERROR_INVAL_MSG, /**< Invalid message */ //70
+ CALL_ERROR_INVAL_MSG, /**< Invalid message */ //70
CALL_ERROR_CALL_BARRED, /**< Call barred */
CALL_ERROR_SIM_CALL_CONTROL_CHANGED_TO_SS, /**< Sim call control changed to SS */
CALL_ERROR_SIM_CALL_CONTROL_CHANGED_TO_CALL, /**< SIM Call control changed to call */
CALL_ERROR_LOWER_LAYER_FAILURE, /**< Lower layer error */
CALL_ERROR_ACCESS_REJECTED, /**< Access rejected */
CALL_ERROR_RESET_NOT_ALLOWED, /**< Reset not allowed */
- CALL_ERROR_EMERGENCY_CALL_NOT_ALLOWED, /**< Emergency call not allowed */ //80
+ CALL_ERROR_EMERGENCY_CALL_NOT_ALLOWED, /**< Emergency call not allowed */ //80
CALL_ERROR_ACCESS_NOT_ALLOWED, /**< Access not allowed */
CALL_ERROR_RADIO_LINK_FAILURE, /**< Radio link failure */
CALL_ERROR_INVALID_IDENTITY, /**< Invalid identity */
CALL_ERROR_SERVICE_NOT_ALLOWED, /**< Service not allowed */
CALL_ERROR_SERVICE_NOT_AVAIL, /**< Service not available */
CALL_ERROR_SERVICE_NOT_WORKING, /**< Service not working */
- CALL_ERROR_CANNOT_IDENTIFY_CALL, /**< Cannot identify the call */ //90
+ CALL_ERROR_CANNOT_IDENTIFY_CALL, /**< Cannot identify the call */ //90
CALL_ERROR_DEACTIVATION, /**< Deactivation */
CALL_ERROR_FATAL_ERROR, /**< Fatal error */
CALL_ERROR_SEND_DTMF_SUCCESS, /**< Sending DTMF Success */
#define MAX_ALPHA_INFO_LEN 64
#define MAX_CALL_CLI_NUM_LEN MAX_CALL_NUMBER_LEN
-#define MAX_CALL_CNA_NAME_LEN 83
+#define MAX_CALL_CNA_NAME_LEN 97
#define MAX_CALL_DISPLAY_INFORMATION 182
unsigned int handle;
enum telephony_call_rec_type type;
union {
- char name[ MAX_ALPHA_INFO_LEN ];
+ char name[ MAX_CALL_CNA_NAME_LEN ];
char number[ MAX_CALL_NUMBER_LEN ];
struct telephony_call_line_ctrl_info line_ctrl;
} data;
};
/* end of IMS specific */
-struct treq_call_set_ecc_status{
+struct treq_call_set_ecc_status {
enum telephony_call_ecc_status status;
};
TREQ_CALL_UPGRADE,
TREQ_CALL_DOWNGRADE,
TREQ_CALL_CONFIRM_UPGRADE,
-
TREQ_CALL_SET_ACTIVE_LINE,
TREQ_CALL_GET_ACTIVE_LINE,
TREQ_CALL_ACTIVATE_CCBS,
TREQ_CALL_CUSTOM_SERVICE,
-
TREQ_CALL_START_CONFERENCE,
TREQ_CALL_MODIFY_PARTICIPANTS_IN_CONFERENCE,
-
TREQ_CALL_SET_ECC_STATUS,
TREQ_SS = TCORE_REQUEST | TCORE_TYPE_SS,
TREQ_SIM_GET_ICON,
TREQ_SIM_SET_POWERSTATE,
TREQ_SIM_GET_GID,
- TREQ_SIM_SET_CPHS_CSP_INFO,
TREQ_SIM_GET_CPHS_CSP_INFO,
TREQ_SIM_GET_IMPI,
TREQ_SIM_GET_IMPU,
TRESP_SIM_SET_POWERSTATE,
TRESP_SIM_GET_GID,
TRESP_SIM_GET_CPHS_CSP_INFO,
- TRESP_SIM_SET_CPHS_CSP_INFO,
TRESP_SIM_GET_IMPI,
TRESP_SIM_GET_IMPU,
TRESP_SIM_GET_DOMAIN,
if (co == NULL)
return NULL;
- co->handle = __assign_handle(o);
+ co->handle = __assign_handle(o);
if (INVALID_HANDLE == co->handle) {
err("valid handle not available. call object creation failed");
tcore_check_null_ret_err("co", co, FALSE);
po->cobjs = g_slist_remove(po->cobjs, co);
+
+ dbg("co_obj with handle [%d] freed", co->handle);
g_free(co);
return TRUE;
return TCORE_RETURN_SUCCESS;
}
-enum co_context_state tcore_context_get_state(CoreObject *o)
+enum co_context_state tcore_context_get_state(CoreObject *o)
{
struct private_object_data *po = NULL;
tcore_network_operator_info_find(CoreObject *co, const char *mcc, const char *mnc)
{
struct private_object_data *po = NULL;
- struct tcore_network_operator_info *data;
+ struct tcore_network_operator_info *data = NULL;
char plmn[NETWORK_MAX_PLMN_LEN+1];
int mcc_index, mnc_index;
return TRUE;
}
}
- } else if ((file_id & 0x6F00) == 0x6F00) {
+ }
+
+ if ((file_id & 0x6F00) == 0x6F00) {
dbg("[SAT] SAT PARSER - ADF_USIM EF=0x%04x", file_id);
for (i = 0; i < 29; i++) {
if (file_id == ef_under_df[i]) {
}
/* length */
- len_of_len = _get_length_filed_size(src_data[temp_index]);
+ len_of_len = _get_length_filed_size(src_data[temp_index+1]);
if (!len_of_len) {
err("[SAT] parser: invalid length.");
return TCORE_SAT_COMMAND_NOT_UNDERSTOOD;
}
- file_list_len = src_data[temp_index + len_of_len-1];
temp_index += len_of_len;
+ file_list_len = src_data[temp_index];
if ((temp_index + file_list_len) > tlv_len) {
dbg("[SAT] SAT PARSER - incorrect cmd len, expected len = %d, orig_len=%d",
return TCORE_SAT_COMMAND_NOT_UNDERSTOOD;
}
+ temp_index++;
tmp_cnt = src_data[temp_index++];
file_list_obj->file_count = 0;
memset(file_list_obj->file_id, 0, SAT_FILE_ID_LIST_MAX_COUNT);
/* USIM DIRECTORY FILE (DIR) 0x7FFF */
temp_index += 2;
if (src_data[temp_index] == 0x6F) {
- ef = 0x6A << 8;
+ ef = src_data[temp_index] << 8;
temp_index++;
ef = ef | src_data[temp_index];
return TCORE_SAT_SUCCESS;
}
- if ((src_data[temp_index] & 0x7F) == SATK_BEARER_DISCRIPTION_TAG) {
+ if ((src_data[temp_index] & 0x7F) == (SATK_BEARER_DISCRIPTION_TAG & 0x7F)) {
dbg("find bearer description tag temp_index(%d)", temp_index);
temp_index++;
break;
/* tag */
temp_index = curr_offset;
src_data = &tlv_str[0];
- if ((src_data[temp_index++] & 0x7F) != SATK_CHANNEL_DATA_TAG) {
+ if ((src_data[temp_index++] & 0x7F) != (SATK_CHANNEL_DATA_TAG & 0x7F)) {
dbg("[SAT] SAT PARSER - tag not found.=%d", src_data[temp_index]);
return TCORE_SAT_COMMAND_NOT_UNDERSTOOD;
}
/* tag */
temp_index = curr_offset;
src_data = &tlv_str[0];
- if ((src_data[temp_index++] & 0x7F) != SATK_CHANNEL_DATA_LEN_TAG) {
+ if ((src_data[temp_index++] & 0x7F) != (SATK_CHANNEL_DATA_LEN_TAG & 0x7F)) {
dbg("[SAT] SAT PARSER - channel data tag missing.");
return TCORE_SAT_COMMAND_NOT_UNDERSTOOD; /* Send TR */
}
/* tag */
temp_index = curr_offset;
src_data = &tlv_str[0];
- if ((src_data[temp_index++] & 0x7F) != SATK_BUFFER_SIZE_TAG) {
+ if ((src_data[temp_index++] & 0x7F) != (SATK_BUFFER_SIZE_TAG & 0x7F)) {
dbg("[SAT] SAT PARSER - buffer size tag missing.");
return TCORE_SAT_COMMAND_NOT_UNDERSTOOD; /* Send TR */
}
dst_tr[temp_index++] = 2;
dst_tr[temp_index++] = src_tr->result_type;
dst_tr[temp_index++] = src_tr->bip_problem_type;
+
+ /* set bearer description */
+ encoded_len = _sat_encode_bearer_desc_tlv(&(src_tr->bearer_desc), dst_tr, temp_index);
+ temp_index += encoded_len;
+
+ /* set buffer size */
+ encoded_len = _sat_encode_buffer_size_tlv(&(src_tr->buffer_size), dst_tr, temp_index);
+ temp_index += encoded_len;
break;
default:
case TREQ_SIM_SET_CALLFORWARDING:
case TREQ_SIM_SET_MESSAGEWAITING:
case TREQ_SIM_SET_MAILBOX:
- case TREQ_SIM_SET_CPHS_CSP_INFO:
tcore_check_null_ret_err("ops->update_file",
ops->update_file, TCORE_RETURN_ENOSYS);
return TRUE;
}
-#if 0
-gboolean tcore_sim_encode_csp(unsigned char *p_out, int out_length, struct tel_sim_cphs_csp *p_csp)
-{
- unsigned char i, j = 0;
-
- if (out_length == 0)
- return FALSE;
-
- memset((void *) p_out, 0xFF, out_length);
-
- /*
- * current telephony supports 22 byte cphs-csp data.
- * 18 byte is mandatory, the other is optional.
- */
- for (i = 0, j = 0;
- i < SIM_CPHS_CSP_LEN_MAX && j < SIM_CPHS_CSP_ENTRY_CNT_MAX;
- i++, j++) {
- p_out[i] = (unsigned char) p_csp->service_profile_entry[j].customer_service_group;
- switch (p_out[i]) {
- case 0x01:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_forwarding_unconditional) << 7)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_forwarding_on_user_busy) << 6)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_forwarding_on_no_reply) << 5)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_forwarding_on_user_not_reachable) << 4)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_transfer) << 3);
- break;
-
- case 0x02:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_all_outgoing_calls) << 7)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_outgoing_international_calls) << 6)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_outgoing_international_calls_except_hplmn) << 5)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_all_incoming_calls_roaming_outside_hplmn) << 4)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_incoming_calls_when_roaming) << 3);
- break;
-
- case 0x03:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_multi_party_service) << 7)
- + (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_closed_user_group) << 6)
- + (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_advice_of_charge) << 5)
- + (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_preferential_closed_user_group) << 4)
- + (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_closed_user_group_outgoing_access) << 3);
- break;
-
- case 0x04:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.call_complete.b_call_hold) << 7)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_complete.b_call_waiting) << 6)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_complete.b_completion_of_call_to_busy_subscriber) << 5)
- + (((unsigned char) p_csp->service_profile_entry[j].service.call_complete.b_user_user_signalling) << 4);
- break;
-
- case 0x05:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_mobile_terminated) << 7)
- + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_mobile_originated) << 6)
- + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_cell_broadcast) << 5)
- + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_reply_path) << 4)
- + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_delivery_conf) << 3)
- + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_protocol_identifier) << 2)
- + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_validity_period) << 1);
- break;
-
- case 0x06:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.cphs_teleservices.b_alternative_line_service) << 7);
- break;
-
- case 0x07:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.cphs_features.b_string_service_table) << 7);
- break;
-
- case 0x08:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_calling_line_identification_present) << 7)
- + (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_connected_line_identification_restrict) << 5)
- + (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_connected_line_identification_present) << 4)
- + (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_malicious_call_identifier) << 3)
- + (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_calling_line_identification_send) << 1)
- + ((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_calling_line_identification_block);
- break;
-
- case 0x09:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_gprs) << 7)
- + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_high_speed_csd) << 6)
- + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_voice_group_call) << 5)
- + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_voice_broadcast_service) << 4)
- + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_multiple_subscriber_profile) << 3)
- + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_multiple_band) << 2);
- break;
-
- case 0xC0:
- p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_manual_selection) << 7)
- + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_voice_mail) << 6)
- + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_mo_sms_and_paging) << 5)
- + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_mo_sms_with_emial_type) << 4)
- + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_fax_calls) << 3)
- + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_data_calls) << 2)
- + ((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_change_language);
- break;
-
- case 0xD5:
- if (p_csp->service_profile_entry[j].service.information_numbers.b_information_numbers)
- p_out[++i] = 0xFF;
- else
- p_out[++i] = 0x00;
- break;
-
- default:
- break;
- }
- }
-
- return TRUE;
-}
-#endif
-
gboolean tcore_sim_decode_mwis(struct tel_sim_mw *pMwis, unsigned char *p_in, int in_length)
{
int i;
gboolean tcore_sim_is_jio_sim(CoreObject *co_sim)
{
struct tel_sim_imsi *imsi = NULL;
- int index, count;
+ int index_s, count;
const char *jio_plmn_list[] = {
/* RJIL */
}
count = sizeof(jio_plmn_list)/sizeof(jio_plmn_list[0]);
- for (index = 0; index < count; index++) {
- if (g_strcmp0(imsi->plmn, jio_plmn_list[index]) == 0) {
+ for (index_s = 0; index_s < count; index_s++) {
+ if (g_strcmp0(imsi->plmn, jio_plmn_list[index_s]) == 0) {
dbg("Jio SIM - PLMN: [%s]", imsi->plmn);
g_free(imsi);
return TRUE;