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 5c5dda59a9e07161614611adaa7411712b5d1ca2..0f9e7febd304fdf1941b70b076873a623c830f7f 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 952805cd17ccb4ec324c4ccc52cf8c8005879733..f6a6dfa9437b46906d42e5caf9f83e395e0da86b 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 37419399b744f5301f4e4625e50bde922c4812c7..879766709272dd2713681bb8bfedc8f1b8d6edf8 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 9029f2bc4e61a3a1a7fed633bdfff824aee24dd9..ca8ba504627b761b50d5346a1fdd5a67b6ffab70 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 de9250835564e0fd946337722c68479d83d7df06..f7fefb9ddcecfeff8b127d509d027217eb4f89e3 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 fea8e7859accb535d3ed073461a1ac74cfc63b82..e4617833e14480b00fc542d344020574ddc9df34 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 f848117c4232010809f14708f7ef0ed95b404472..90b674012a7ca988e48d82cb7c1eba1f39dc81b8 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 8d26ec978be1e0b1245a370a34ed9513446361fe..2435cd29cf55d77f839f6bb235f30f4937047fb7 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);