From 259a627619475aa948e193960880d673765c1869 Mon Sep 17 00:00:00 2001 From: Sangkoo Kim Date: Thu, 29 Nov 2012 21:25:32 +0900 Subject: [PATCH] Add validation system log of sms. Change-Id: Ica68c30d7dc352b9d3b26a355329c5987b007ecf --- include/common/MsgInternalTypes.h | 2 +- include/utils/MsgDebug.h | 16 ++++++++++++++++ packaging/msg-service.spec | 1 + plugin/sms_plugin/SmsPluginCallback.cpp | 26 ++++++++++++++++++++++++++ plugin/sms_plugin/SmsPluginSetting.cpp | 10 ++++++++-- plugin/sms_plugin/SmsPluginTransport.cpp | 25 +++++++++++++++++++++---- plugin/sms_plugin/include/SmsPluginCallback.h | 2 ++ plugin/sms_plugin/include/SmsPluginSetting.h | 1 + 8 files changed, 76 insertions(+), 7 deletions(-) diff --git a/include/common/MsgInternalTypes.h b/include/common/MsgInternalTypes.h index 5c5dda5..0f9e7fe 100755 --- a/include/common/MsgInternalTypes.h +++ b/include/common/MsgInternalTypes.h @@ -53,7 +53,7 @@ /*vconf keys*/ #define MSG_SIM_IMSI "memory/private/msg-service/sim_imsi" #define MSG_SIM_CHANGED "memory/private/msg-service/sim_changed" - +#define MSG_SIM_MSISDN "memory/private/msg-service/msisdn" #define DEFAULT_SETTING_PATH "db/private/msg-service" diff --git a/include/utils/MsgDebug.h b/include/utils/MsgDebug.h index 952805c..f6a6dfa 100755 --- a/include/utils/MsgDebug.h +++ b/include/utils/MsgDebug.h @@ -40,6 +40,9 @@ extern "C"{ ==================================================================================================*/ #define USER_TAG "MSG_FW" +#define MSG_SMS_VALID_TAG "VLD_SMS" +#define MSG_MMS_VALID_TAG "VLD_MMS" + #define DLOG_ENABLE //#define LOG_ENABLE @@ -102,6 +105,19 @@ int get_tid(); (unsigned int)(__dm)); \ } while (0) + +#define MSG_SMS_VLD(fmt, ...)\ + do\ + {\ + SLOG(LOG_DEBUG, MSG_SMS_VALID_TAG, "%s, "fmt"\n", __TIMESTAMP__, ##__VA_ARGS__);\ + } while (0) + +#define MSG_MMS_VLD(fmt, ...)\ + do\ + {\ + SLOG(LOG_DEBUG, MSG_MMS_VALID_TAG, "%s, "fmt"\n", __TIMESTAMP__, ##__VA_ARGS__);\ + } while (0) + #elif defined(LOG_ENABLE) #define MSG_FATAL(fmt, ...) \ diff --git a/packaging/msg-service.spec b/packaging/msg-service.spec index 3741939..8797667 100755 --- a/packaging/msg-service.spec +++ b/packaging/msg-service.spec @@ -337,6 +337,7 @@ vconftool set -t int db/private/msg-service/sim_count/total_cnt 0 vconftool set -t int memory/private/msg-service/sim_changed 0 -i vconftool set -t string memory/private/msg-service/sim_imsi "" -i vconftool set -t bool memory/private/msg-service/national_sim 0 -i +vconftool set -t string memory/private/msg-service/msisdn "" -i /sbin/ldconfig /bin/systemctl daemon-reload diff --git a/plugin/sms_plugin/SmsPluginCallback.cpp b/plugin/sms_plugin/SmsPluginCallback.cpp index 9029f2b..ca8ba50 100755 --- a/plugin/sms_plugin/SmsPluginCallback.cpp +++ b/plugin/sms_plugin/SmsPluginCallback.cpp @@ -756,6 +756,32 @@ void TapiEventGetMwiInfo(TapiHandle *handle, int result, void *data, void *user_ #endif } +void TapiEventGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data) +{ +#if 0 // New TAPI + MSG_DEBUG("TapiEventGetMsisdnInfo is called."); + + if (result != TAPI_SIM_ACCESS_SUCCESS || data == NULL) + { + MSG_DEBUG("Error. data is NULL."); + return; + } + + TelSimMsisdnList_t *list = (TelSimMsisdnList_t *)data; + + for (int i = 0; i < list->count; i++) { + if (list->list[i].num[0] != '\0') { + if (MsgSettingSetString(MSG_SIM_MSISDN, list->list[i].num) == MSG_SUCCESS) + MSG_DEBUG("Get MSISDN from SIM : [%s]", list->list[i].num); + else + MSG_DEBUG("Getting MSISDN is failed!"); + + break; + } + } +#endif +} + void TapiEventSatSmsRefresh(TapiHandle *handle, int result, void *data, void *user_data) { MSG_DEBUG("TapiEventSatSmsRefresh is called."); diff --git a/plugin/sms_plugin/SmsPluginSetting.cpp b/plugin/sms_plugin/SmsPluginSetting.cpp index de92508..f7fefb9 100755 --- a/plugin/sms_plugin/SmsPluginSetting.cpp +++ b/plugin/sms_plugin/SmsPluginSetting.cpp @@ -156,13 +156,19 @@ void SmsPluginSetting::initConfigData(MSG_SIM_STATUS_T SimStatus) if (getVoiceMailInfo(&tmpVoiceMail) == true) { MSG_DEBUG("######## getVoiceMailInfo Success !!! #######"); } else { - MSG_DEBUG("######## getVoiceMailInfo Fail !!! #######", err); + MSG_DEBUG("######## getVoiceMailInfo Fail !!! #######"); } if (getMwiInfo() == true) { MSG_DEBUG("######## getMwiInfo Success !!! #######"); } else { - MSG_DEBUG("######## getMwiInfo Fail !!! #######", err); + MSG_DEBUG("######## getMwiInfo Fail !!! #######"); + } + + if (getMsisdnInfo() == true) { + MSG_DEBUG("######## getMsisdnInfo Success !!! #######"); + } else { + MSG_DEBUG("######## getMsisdnInfo Fail !!! #######"); } } diff --git a/plugin/sms_plugin/SmsPluginTransport.cpp b/plugin/sms_plugin/SmsPluginTransport.cpp index fea8e78..e461783 100755 --- a/plugin/sms_plugin/SmsPluginTransport.cpp +++ b/plugin/sms_plugin/SmsPluginTransport.cpp @@ -202,20 +202,37 @@ void SmsPluginTransport::submitRequest(SMS_REQUEST_INFO_S *pReqInfo) if (tapiRet == TAPI_API_SUCCESS) { - MSG_DEBUG("######## TelTapiSmsSend Success !!! req Id : [%d] return : [%d] #######", reqId, tapiRet); + MSG_DEBUG("######## TelTapiSmsSend Success !!! return : [%d] #######", tapiRet); } else { SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL); - THROW(MsgException::SMS_PLG_ERROR, "######## TelTapiSmsSend Fail !!! req Id : [%d] return : [%d] #######", reqId, tapiRet); + THROW(MsgException::SMS_PLG_ERROR, "######## TelTapiSmsSend Fail !!! return : [%d] #######", tapiRet); } + // Tizen Validation System + char *msisdn = NULL; + msisdn = MsgSettingGetString(MSG_SIM_MSISDN); + + MSG_SMS_VLD("[SMS INFO] %d, SMS Send Start, %s->%s, %s", pReqInfo->msgInfo.msgId, \ + (msisdn == NULL)?"ME":msisdn, \ + pReqInfo->msgInfo.addressList[0].addressVal, \ + (tapiRet == TAPI_API_SUCCESS)?"Success":"Fail"); + + MSG_SMS_VLD("[SMS TEXT] %d, [%s]", pReqInfo->msgInfo.msgId, pReqInfo->msgInfo.msgText); + msg_network_status_t retStatus = getNetStatus(); + MSG_SMS_VLD("[SMS INFO] %d, SMS Send End, %s->%s, %s", pReqInfo->msgInfo.msgId, \ + (msisdn == NULL)?"ME":msisdn, \ + pReqInfo->msgInfo.addressList[0].addressVal, \ + (retStatus == MSG_NETWORK_SEND_SUCCESS)?"Success":"Fail"); + + if (retStatus == MSG_NETWORK_SEND_SUCCESS) { - MSG_DEBUG("######## Msg Sent was Successful !!! req Id : [%d] return : [%d] #######", reqId, retStatus); + MSG_DEBUG("######## Msg Sent was Successful !!! return : [%d] #######", retStatus); } else { @@ -223,7 +240,7 @@ void SmsPluginTransport::submitRequest(SMS_REQUEST_INFO_S *pReqInfo) SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_FAIL); - THROW(MsgException::SMS_PLG_ERROR, "######## Msg Sent was Failed !!! req Id : [%d] return : [%d] #######", reqId, retStatus); + THROW(MsgException::SMS_PLG_ERROR, "######## Msg Sent was Failed !!! return : [%d] #######", retStatus); } if (tpdu.data.submit.userData.headerCnt > 0) tpdu.data.submit.userData.headerCnt--; diff --git a/plugin/sms_plugin/include/SmsPluginCallback.h b/plugin/sms_plugin/include/SmsPluginCallback.h index f848117..90b6740 100755 --- a/plugin/sms_plugin/include/SmsPluginCallback.h +++ b/plugin/sms_plugin/include/SmsPluginCallback.h @@ -58,6 +58,8 @@ void TapiEventGetMailboxInfo(TapiHandle *handle, int result, void *data, void *u void TapiEventSetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data); void TapiEventGetMwiInfo(TapiHandle *handle, int result, void *data, void *user_data); +void TapiEventGetMsisdnInfo(TapiHandle *handle, int result, void *data, void *user_data); + void TapiEventGetParamCnt(TapiHandle *handle, int result, void *data, void *user_data); void TapiEventGetParam(TapiHandle *handle, int result, void *data, void *user_data); diff --git a/plugin/sms_plugin/include/SmsPluginSetting.h b/plugin/sms_plugin/include/SmsPluginSetting.h index 8d26ec9..2435cd2 100755 --- a/plugin/sms_plugin/include/SmsPluginSetting.h +++ b/plugin/sms_plugin/include/SmsPluginSetting.h @@ -67,6 +67,7 @@ private: void setVoiceMailInfo(const MSG_VOICEMAIL_OPT_S *pVoiceOpt); bool getVoiceMailInfo(MSG_VOICEMAIL_OPT_S *pVoiceOpt); bool getMwiInfo(void); + bool getMsisdnInfo(void); int getParamCntEvent(); bool getParamEvent(MSG_SMSC_DATA_S *pSmscData); -- 2.7.4