Add validation system log of sms.
authorSangkoo Kim <sangkoo.kim@samsung.com>
Thu, 29 Nov 2012 12:25:32 +0000 (21:25 +0900)
committerSangkoo Kim <sangkoo.kim@samsung.com>
Thu, 29 Nov 2012 12:25:32 +0000 (21:25 +0900)
Change-Id: Ica68c30d7dc352b9d3b26a355329c5987b007ecf

include/common/MsgInternalTypes.h
include/utils/MsgDebug.h
packaging/msg-service.spec
plugin/sms_plugin/SmsPluginCallback.cpp
plugin/sms_plugin/SmsPluginSetting.cpp
plugin/sms_plugin/SmsPluginTransport.cpp
plugin/sms_plugin/include/SmsPluginCallback.h
plugin/sms_plugin/include/SmsPluginSetting.h

index 5c5dda5..0f9e7fe 100755 (executable)
@@ -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"
 
index 952805c..f6a6dfa 100755 (executable)
@@ -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, ...) \
index 3741939..8797667 100755 (executable)
@@ -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
index 9029f2b..ca8ba50 100755 (executable)
@@ -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.");
index de92508..f7fefb9 100755 (executable)
@@ -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 !!! #######");
                }
        }
 
index fea8e78..e461783 100755 (executable)
@@ -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--;
index f848117..90b6740 100755 (executable)
@@ -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);
 
index 8d26ec9..2435cd2 100755 (executable)
@@ -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);