From 13e24c51470bae639fdc1106a7c0c322a4683468 Mon Sep 17 00:00:00 2001 From: Seunghwan Lee Date: Fri, 21 Dec 2012 11:13:57 +0900 Subject: [PATCH] Apply VLD_MMS : Validation check of MMS send/receive Append definition FEATURE_JAVA_MMS/__SUPPORT_DRM__ at CMakeList --- include/common/MsgTypes.h | 11 - include/mapi/msg_types.h | 2 +- include/utils/MsgUtilFile.h | 2 +- plugin/mms_plugin/CMakeLists.txt | 4 +- plugin/mms_plugin/MmsPluginAvCodec.cpp | 2 +- plugin/mms_plugin/MmsPluginCodecCommon.cpp | 673 ++++++++++++++++++++- plugin/mms_plugin/MmsPluginConnManWrapper.cpp | 1 + plugin/mms_plugin/MmsPluginDebug.cpp | 549 ----------------- plugin/mms_plugin/MmsPluginDecode.cpp | 16 +- plugin/mms_plugin/MmsPluginDrm.cpp | 7 +- plugin/mms_plugin/MmsPluginEncode.cpp | 7 +- plugin/mms_plugin/MmsPluginEventHandler.cpp | 18 +- plugin/mms_plugin/MmsPluginHttp.cpp | 9 +- plugin/mms_plugin/MmsPluginInternal.cpp | 30 +- plugin/mms_plugin/MmsPluginMIME.cpp | 4 +- plugin/mms_plugin/MmsPluginMain.cpp | 17 +- plugin/mms_plugin/MmsPluginMessage.cpp | 361 +---------- plugin/mms_plugin/MmsPluginSMILValidate.cpp | 6 +- plugin/mms_plugin/MmsPluginSmil.cpp | 14 +- plugin/mms_plugin/MmsPluginStorage.cpp | 84 ++- plugin/mms_plugin/MmsPluginTextConvert.cpp | 2 +- plugin/mms_plugin/MmsPluginTransport.cpp | 19 +- plugin/mms_plugin/MmsPluginUserAgent.cpp | 14 +- plugin/mms_plugin/MmsPluginUtil.cpp | 84 ++- plugin/mms_plugin/include/MmsPluginAvCodec.h | 8 +- plugin/mms_plugin/include/MmsPluginCodec.h | 6 +- plugin/mms_plugin/include/MmsPluginCodecCommon.h | 22 +- plugin/mms_plugin/include/MmsPluginCodecTypes.h | 18 +- .../mms_plugin/include/MmsPluginConnManWrapper.h | 12 +- plugin/mms_plugin/include/MmsPluginDebug.h | 20 +- plugin/mms_plugin/include/MmsPluginDecode.h | 8 +- plugin/mms_plugin/include/MmsPluginDrm.h | 12 +- plugin/mms_plugin/include/MmsPluginEncode.h | 3 +- plugin/mms_plugin/include/MmsPluginEventHandler.h | 9 - plugin/mms_plugin/include/MmsPluginHttp.h | 58 +- plugin/mms_plugin/include/MmsPluginInternal.h | 14 +- plugin/mms_plugin/include/MmsPluginMIME.h | 19 +- plugin/mms_plugin/include/MmsPluginMain.h | 8 +- plugin/mms_plugin/include/MmsPluginMessage.h | 44 +- plugin/mms_plugin/include/MmsPluginSMILValidate.h | 15 +- plugin/mms_plugin/include/MmsPluginSmil.h | 15 +- plugin/mms_plugin/include/MmsPluginStorage.h | 12 +- plugin/mms_plugin/include/MmsPluginTextConvert.h | 12 +- plugin/mms_plugin/include/MmsPluginTransport.h | 12 - plugin/mms_plugin/include/MmsPluginTypes.h | 159 +---- plugin/mms_plugin/include/MmsPluginUserAgent.h | 14 +- plugin/mms_plugin/include/MmsPluginUtil.h | 13 - utils/CMakeLists.txt | 2 + 48 files changed, 997 insertions(+), 1454 deletions(-) delete mode 100755 plugin/mms_plugin/MmsPluginDebug.cpp diff --git a/include/common/MsgTypes.h b/include/common/MsgTypes.h index 3a6671e..a15aaa4 100755 --- a/include/common/MsgTypes.h +++ b/include/common/MsgTypes.h @@ -56,17 +56,6 @@ #define MMS_V1_2 // MMS Version : MMS_V1_0 / MMS_V1_1 / MMS_V1_2 /** - * @brief Defines the enabled DRM support - */ -#define __SUPPORT_DRM__ - -/** - * @brief Defines the enabled JAVA MMS Application Id - */ -#define FEATURE_JAVA_MMS - - -/** * @brief Defines message struct handle. */ diff --git a/include/mapi/msg_types.h b/include/mapi/msg_types.h index ce44eaa..a528b39 100755 --- a/include/mapi/msg_types.h +++ b/include/mapi/msg_types.h @@ -69,7 +69,7 @@ /** * @brief Defines the maximum file name length */ -#define MSG_FILENAME_LEN_MAX 255 +#define MSG_FILENAME_LEN_MAX 1024 /** * @brief Defines the maximum message id length diff --git a/include/utils/MsgUtilFile.h b/include/utils/MsgUtilFile.h index 7081c08..deece31 100755 --- a/include/utils/MsgUtilFile.h +++ b/include/utils/MsgUtilFile.h @@ -17,7 +17,7 @@ #ifndef MSG_UTIL_FILE_H #define MSG_UTIL_FILE_H - +#include /*================================================================================================== DEFINES ==================================================================================================*/ diff --git a/plugin/mms_plugin/CMakeLists.txt b/plugin/mms_plugin/CMakeLists.txt index 3e0cdd6..047d7b5 100755 --- a/plugin/mms_plugin/CMakeLists.txt +++ b/plugin/mms_plugin/CMakeLists.txt @@ -25,7 +25,6 @@ SET(MMS-PLUGIN-SRCS MmsPluginMessage.cpp MmsPluginMIME.cpp MmsPluginAvCodec.cpp - MmsPluginDebug.cpp MmsPluginConnManWrapper.cpp MmsPluginUserAgent.cpp MmsPluginHttp.cpp @@ -56,7 +55,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}") SET(CMAKE_CXX_FLAGS_DEBUG "-O2 -g") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") -#ADD_DEFINITIONS("-DWno-write-strings") +ADD_DEFINITIONS("-DFEATURE_JAVA_MMS") +ADD_DEFINITIONS("-D__SUPPORT_DRM__") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined") diff --git a/plugin/mms_plugin/MmsPluginAvCodec.cpp b/plugin/mms_plugin/MmsPluginAvCodec.cpp index 0631bdd..323de7b 100755 --- a/plugin/mms_plugin/MmsPluginAvCodec.cpp +++ b/plugin/mms_plugin/MmsPluginAvCodec.cpp @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "MmsPluginAvCodec.h" #include +#include "MmsPluginAvCodec.h" AvCodecType AvGetFileCodecType(const char *szFileName) { diff --git a/plugin/mms_plugin/MmsPluginCodecCommon.cpp b/plugin/mms_plugin/MmsPluginCodecCommon.cpp index 90fe694..86878c4 100755 --- a/plugin/mms_plugin/MmsPluginCodecCommon.cpp +++ b/plugin/mms_plugin/MmsPluginCodecCommon.cpp @@ -15,7 +15,7 @@ */ #include -#include "MsgDebug.h" +#include "MmsPluginDebug.h" #include "MmsPluginCodecCommon.h" #include "MmsPluginMIME.h" #include "MmsPluginUtil.h" @@ -1131,3 +1131,674 @@ __CATCH: return NULL; } + + +static char gszDebugStringBuf[50]; + +static char *MmsDebugPrintUnknownValue(int value) +{ + printf(gszDebugStringBuf, "unknown value(%d)", value); + return gszDebugStringBuf; +} + + +const char *MmsDebugGetMimeType(MimeType mimeType) +{ + switch (mimeType) { + case MIME_APPLICATION_XML: + return "MIME_APPLICATION_XML"; + case MIME_APPLICATION_WML_XML: + return "MIME_APPLICATION_WML_XML"; + case MIME_APPLICATION_XHTML_XML: + return "MIME_APPLICATION_XHTML_XML"; + case MIME_APPLICATION_JAVA_VM: + return "MIME_APPLICATION_JAVA_VM"; + case MIME_APPLICATION_SMIL: + return "MIME_APPLICATION_SMIL"; + case MIME_APPLICATION_JAVA_ARCHIVE: + return "MIME_APPLICATION_JAVA_ARCHIVE"; + case MIME_APPLICATION_JAVA: + return "MIME_APPLICATION_JAVA"; + case MIME_APPLICATION_OCTET_STREAM: + return "MIME_APPLICATION_OCTET_STREAM"; + case MIME_APPLICATION_STUDIOM: + return "MIME_APPLICATION_STUDIOM"; + case MIME_APPLICATION_FUNMEDIA: + return "MIME_APPLICATION_FUNMEDIA"; + case MIME_APPLICATION_MSWORD: + return "MIME_APPLICATION_MSWORD"; + case MIME_APPLICATION_PDF: + return "MIME_APPLICATION_PDF"; + case MIME_APPLICATION_ASTERIC: + return "MIME_APPLICATION_ASTERIC"; + case MIME_APPLICATION_VND_WAP_XHTMLXML: + return "MIME_APPLICATION_VND_WAP_XHTMLXML"; + case MIME_APPLICATION_VND_WAP_WMLC: + return "MIME_APPLICATION_VND_WAP_WMLC"; + case MIME_APPLICATION_VND_WAP_WMLSCRIPTC: + return "MIME_APPLICATION_VND_WAP_WMLSCRIPTC"; + case MIME_APPLICATION_VND_WAP_WTA_EVENTC: + return "MIME_APPLICATION_VND_WAP_WTA_EVENTC"; + case MIME_APPLICATION_VND_WAP_UAPROF: + return "MIME_APPLICATION_VND_WAP_UAPROF"; + case MIME_APPLICATION_VND_WAP_SIC: + return "MIME_APPLICATION_VND_WAP_SIC"; + case MIME_APPLICATION_VND_WAP_SLC: + return "MIME_APPLICATION_VND_WAP_SLC"; + case MIME_APPLICATION_VND_WAP_COC: + return "MIME_APPLICATION_VND_WAP_COC"; + case MIME_APPLICATION_VND_WAP_SIA: + return "MIME_APPLICATION_VND_WAP_SIA"; + case MIME_APPLICATION_VND_WAP_CONNECTIVITY_WBXML: + return "MIME_APPLICATION_VND_WAP_CONNECTIVITY_WBXML"; + case MIME_APPLICATION_VND_WAP_MULTIPART_FORM_DATA: + return "MIME_APPLICATION_VND_WAP_MULTIPART_FORM_DATA"; + case MIME_APPLICATION_VND_WAP_MULTIPART_BYTERANGES: + return "MIME_APPLICATION_VND_WAP_MULTIPART_BYTERANGES"; + case MIME_APPLICATION_VND_WAP_MULTIPART_MIXED: + return "MIME_APPLICATION_VND_WAP_MULTIPART_MIXED"; + case MIME_APPLICATION_VND_WAP_MULTIPART_RELATED: + return "MIME_APPLICATION_VND_WAP_MULTIPART_RELATED"; + case MIME_APPLICATION_VND_WAP_MULTIPART_ALTERNATIVE: + return "MIME_APPLICATION_VND_WAP_MULTIPART_ALTERNATIVE"; + case MIME_APPLICATION_VND_WAP_MULTIPART_ASTERIC: + return "MIME_APPLICATION_VND_WAP_MULTIPART_ASTERIC"; + case MIME_APPLICATION_VND_OMA_DD_XML: + return "MIME_APPLICATION_VND_OMA_DD_XML"; + case MIME_APPLICATION_VND_OMA_DRM_MESSAGE: + return "MIME_APPLICATION_VND_OMA_DRM_MESSAGE"; + case MIME_APPLICATION_VND_OMA_DRM_CONTENT: + return "MIME_APPLICATION_VND_OMA_DRM_CONTENT"; + case MIME_APPLICATION_VND_OMA_DRM_RIGHTS_XML: + return "MIME_APPLICATION_VND_OMA_DRM_RIGHTS_XML"; + case MIME_APPLICATION_VND_OMA_DRM_RIGHTS_WBXML: + return "MIME_APPLICATION_VND_OMA_DRM_RIGHTS_WBXML"; + case MIME_APPLICATION_VND_SMAF: + return "MIME_APPLICATION_VND_SMAF"; + case MIME_APPLICATION_VND_RN_REALMEDIA: + return "MIME_APPLICATION_VND_RN_REALMEDIA"; + case MIME_APPLICATION_VND_SUN_J2ME_JAVA_ARCHIVE: + return "MIME_APPLICATION_VND_SUN_J2ME_JAVA_ARCHIVE"; + case MIME_APPLICATION_VND_SAMSUNG_THEME: + return "MIME_APPLICATION_VND_SAMSUNG_THEME"; + case MIME_APPLICATION_VND_EXCEL: + return "MIME_APPLICATION_VND_EXCEL"; + case MIME_APPLICATION_X_HDMLC: + return "MIME_APPLICATION_X_HDMLC"; + case MIME_APPLICATION_X_X968_USERCERT: + return "MIME_APPLICATION_X_X968_USERCERT"; + case MIME_APPLICATION_X_WWW_FORM_URLENCODED: + return "MIME_APPLICATION_X_WWW_FORM_URLENCODED"; + case MIME_APPLICATION_X_SMAF: + return "MIME_APPLICATION_X_SMAF"; + case MIME_APPLICATION_X_FLASH: + return "MIME_APPLICATION_X_FLASH"; + case MIME_APPLICATION_X_EXCEL: + return "MIME_APPLICATION_X_EXCEL"; + case MIME_APPLICATION_X_POWERPOINT: + return "MIME_APPLICATION_X_POWERPOINT"; + + case MIME_AUDIO_BASIC: + return "MIME_AUDIO_BASIC"; + case MIME_AUDIO_MPEG: + return "MIME_AUDIO_MPEG"; + case MIME_AUDIO_MP3: + return "MIME_AUDIO_MP3"; + case MIME_AUDIO_MPG3: + return "MIME_AUDIO_MPG3"; + case MIME_AUDIO_MPEG3: + return "MIME_AUDIO_MPEG3"; + case MIME_AUDIO_MPG: + return "MIME_AUDIO_MPG"; + case MIME_AUDIO_AAC: + return "MIME_AUDIO_AAC"; + case MIME_AUDIO_G72: + return "MIME_AUDIO_G72"; + case MIME_AUDIO_AMR: + return "MIME_AUDIO_AMR"; + case MIME_AUDIO_AMR_WB: + return "MIME_AUDIO_AMR_WB"; + case MIME_AUDIO_MMF: + return "MIME_AUDIO_MMF"; + case MIME_AUDIO_SMAF: + return "MIME_AUDIO_SMAF"; + case MIME_AUDIO_IMELODY: + return "MIME_AUDIO_IMELODY"; + case MIME_AUDIO_MELODY: + return "MIME_AUDIO_MELODY"; + case MIME_AUDIO_MID: + return "MIME_AUDIO_MID"; + case MIME_AUDIO_MIDI: + return "MIME_AUDIO_MIDI"; + case MIME_AUDIO_X_MID: + return "MIME_AUDIO_X_MID"; + case MIME_AUDIO_SP_MIDI: + return "MIME_AUDIO_SP_MIDI"; + case MIME_AUDIO_WAVE: + return "MIME_AUDIO_WAVE"; + case MIME_AUDIO_3GPP: + return "MIME_AUDIO_3GPP"; + case MIME_AUDIO_MP4: + return "MIME_AUDIO_MP4"; + case MIME_AUDIO_MP4A_LATM: + return "MIME_AUDIO_MP4A_LATM"; + case MIME_AUDIO_VND_RN_REALAUDIO: + return "MIME_AUDIO_VND_RN_REALAUDIO"; + case MIME_AUDIO_X_MPEG: + return "MIME_AUDIO_X_MPEG"; + case MIME_AUDIO_X_MP3: + return "MIME_AUDIO_X_MP3"; + case MIME_AUDIO_X_MPEG3: + return "MIME_AUDIO_X_MPEG3"; + case MIME_AUDIO_X_MPG: + return "MIME_AUDIO_X_MPG"; + case MIME_AUDIO_X_AMR: + return "MIME_AUDIO_X_AMR"; + case MIME_AUDIO_X_MMF: + return "MIME_AUDIO_X_MMF"; + case MIME_AUDIO_X_SMAF: + return "MIME_AUDIO_X_SMAF"; + case MIME_AUDIO_X_IMELODY: + return "MIME_AUDIO_X_IMELODY"; + case MIME_AUDIO_X_MIDI: + return "MIME_AUDIO_X_MIDI"; + case MIME_AUDIO_X_MPEGAUDIO: + return "MIME_AUDIO_X_MPEGAUDIO"; + case MIME_AUDIO_X_PN_REALAUDIO: + return "MIME_AUDIO_X_PN_REALAUDIO"; + case MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO: + return "MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO"; + case MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO_LIVE: + return "MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO_LIVE"; + case MIME_AUDIO_X_WAV: + return "MIME_AUDIO_X_WAV"; + + case MIME_IMAGE_GIF: + return "MIME_IMAGE_GIF"; + case MIME_IMAGE_JPEG: + return "MIME_IMAGE_JPEG"; + case MIME_IMAGE_JPG: + return "MIME_IMAGE_JPG"; + case MIME_IMAGE_TIFF: + return "MIME_IMAGE_TIFF"; + case MIME_IMAGE_TIF: + return "MIME_IMAGE_TIF"; + case MIME_IMAGE_PNG: + return "MIME_IMAGE_PNG"; + case MIME_IMAGE_WBMP: + return "MIME_IMAGE_WBMP"; + case MIME_IMAGE_PJPEG: + return "MIME_IMAGE_PJPEG"; + case MIME_IMAGE_BMP: + return "MIME_IMAGE_BMP"; + case MIME_IMAGE_SVG: + return "MIME_IMAGE_SVG"; + case MIME_IMAGE_SVG1: + return "MIME_IMAGE_SVG1"; + case MIME_IMAGE_VND_WAP_WBMP: + return "MIME_IMAGE_VND_WAP_WBMP"; + + case MIME_IMAGE_X_BMP: + return "MIME_IMAGE_X_BMP"; + + case MIME_MESSAGE_RFC822: + return "MIME_MESSAGE_RFC822"; + + case MIME_MULTIPART_MIXED: + return "MIME_MULTIPART_MIXED"; + case MIME_MULTIPART_RELATED: + return "MIME_MULTIPART_RELATED"; + case MIME_MULTIPART_ALTERNATIVE: + return "MIME_MULTIPART_ALTERNATIVE"; + case MIME_MULTIPART_FORM_DATA: + return "MIME_MULTIPART_FORM_DATA"; + case MIME_MULTIPART_BYTERANGE: + return "MIME_MULTIPART_BYTERANGE"; + case MIME_MULTIPART_REPORT: + return "MIME_MULTIPART_REPORT"; + + case MIME_TEXT_TXT: + return "MIME_TEXT_TXT"; + case MIME_TEXT_HTML: + return "MIME_TEXT_HTML"; + case MIME_TEXT_PLAIN: + return "MIME_TEXT_PLAIN"; + case MIME_TEXT_CSS: + return "MIME_TEXT_CSS"; + case MIME_TEXT_XML: + return "MIME_TEXT_XML"; + case MIME_TEXT_IMELODY: + return "MIME_TEXT_IMELODY"; + case MIME_TEXT_VND_WAP_WMLSCRIPT: + return "MIME_TEXT_VND_WAP_WMLSCRIPT"; + case MIME_TEXT_VND_WAP_WML: + return "MIME_TEXT_VND_WAP_WML"; + case MIME_TEXT_VND_WAP_WTA_EVENT: + return "MIME_TEXT_VND_WAP_WTA_EVENT"; + case MIME_TEXT_VND_WAP_CONNECTIVITY_XML: + return "MIME_TEXT_VND_WAP_CONNECTIVITY_XML"; + case MIME_TEXT_VND_WAP_SI: + return "MIME_TEXT_VND_WAP_SI"; + case MIME_TEXT_VND_WAP_SL: + return "MIME_TEXT_VND_WAP_SL"; + case MIME_TEXT_VND_WAP_CO: + return "MIME_TEXT_VND_WAP_CO"; + case MIME_TEXT_VND_SUN_J2ME_APP_DESCRIPTOR: + return "MIME_TEXT_VND_SUN_J2ME_APP_DESCRIPTOR"; + case MIME_TEXT_X_HDML: + return "MIME_TEXT_X_HDML"; + case MIME_TEXT_X_VCALENDAR: + return "MIME_TEXT_X_VCALENDAR"; + case MIME_TEXT_X_VCARD: + return "MIME_TEXT_X_VCARD"; + case MIME_TEXT_X_IMELODY: + return "MIME_TEXT_X_IMELODY"; + + case MIME_VIDEO_MPEG4: + return "MIME_VIDEO_MPEG4"; + case MIME_VIDEO_MP4: + return "MIME_VIDEO_MP4"; + case MIME_VIDEO_H263: + return "MIME_VIDEO_H263"; + case MIME_VIDEO_3GPP: + return "MIME_VIDEO_3GPP"; + case MIME_VIDEO_3GP: + return "MIME_VIDEO_3GP"; + case MIME_VIDEO_AVI: + return "MIME_VIDEO_AVI"; + case MIME_VIDEO_SDP: + return "MIME_VIDEO_SDP"; + case MIME_VIDEO_VND_RN_REALVIDEO: + return "MIME_VIDEO_VND_RN_REALVIDEO"; + case MIME_VIDEO_X_MP4: + return "MIME_VIDEO_X_MP4"; + case MIME_VIDEO_X_PV_MP4: + return "MIME_VIDEO_X_PV_MP4"; + case MIME_VIDEO_X_PN_REALVIDEO: + return "MIME_VIDEO_X_PN_REALVIDEO"; + case MIME_VIDEO_X_PN_MULTIRATE_REALVIDEO: + return "MIME_VIDEO_X_PN_MULTIRATE_REALVIDEO"; + default: + return MmsDebugPrintUnknownValue(mimeType); + } +} + + +/* MsgMmsMsg.h */ +const char *MmsDebugGetMmsReport(MmsReport report) +{ + switch (report) { + case MMS_REPORT_ERROR: + return "MMS_REPORT_ERROR"; + case MMS_REPORT_YES: + return "MMS_REPORT_YES"; + case MMS_REPORT_NO: + return "MMS_REPORT_NO"; + } + + return MmsDebugPrintUnknownValue(report); +} + + +const char *MmsDebugGetMmsReportAllowed(MmsReportAllowed reportAllowed) +{ + switch (reportAllowed) { + case MMS_REPORTALLOWED_ERROR: + return "MMS_REPORTALLOWED_ERROR"; + case MMS_REPORTALLOWED_YES: + return "MMS_REPORTALLOWED_YES"; + case MMS_REPORTALLOWED_NO: + return "MMS_REPORTALLOWED_NO"; + } + + return MmsDebugPrintUnknownValue(reportAllowed); +} + + +const char *MmsDebugGetMmsReadStatus(msg_read_report_status_t readStatus) +{ + _MSG_READ_REPORT_STATUS_E readReport = (_MSG_READ_REPORT_STATUS_E)readStatus; + + switch (readReport) { + case MSG_READ_REPORT_NONE: + return "MMS_READSTATUS_NONE"; + case MSG_READ_REPORT_IS_READ: + return "MMS_IS_READ"; + case MSG_READ_REPORT_IS_DELETED: + return "MMS_IS_DELETED"; + } + + return MmsDebugPrintUnknownValue(readStatus); +} + +const char *MmsDebugGetMsgType(MmsMsgType msgType) +{ + switch (msgType) { + case MMS_MSGTYPE_ERROR: + return "error"; + case MMS_MSGTYPE_SEND_REQ: + return "send.req"; + case MMS_MSGTYPE_SEND_CONF: + return "send.conf"; + case MMS_MSGTYPE_NOTIFICATION_IND: + return "notification.ind"; + case MMS_MSGTYPE_NOTIFYRESP_IND: + return "notifyResp.ind"; + case MMS_MSGTYPE_RETRIEVE_CONF: + return "retrieve conf"; + case MMS_MSGTYPE_ACKNOWLEDGE_IND: + return "acknowledge ind"; + case MMS_MSGTYPE_DELIVERY_IND: + return "delivery ind"; + case MMS_MSGTYPE_READREC_IND: + return "read rec ind"; + case MMS_MSGTYPE_READORG_IND: + return "read org ind"; + case MMS_MSGTYPE_FORWARD_REQ: + return "forward req"; + case MMS_MSGTYPE_FORWARD_CONF: + return "forward conf"; + case MMS_MSGTYPE_READ_REPLY: + return "read reply"; + default: + return MmsDebugPrintUnknownValue(msgType); + } +} + +const char *MmsDebugGetResponseStatus(MmsResponseStatus responseStatus) +{ + switch (responseStatus) { + case MMS_RESPSTATUS_ERROR: + return "error"; + case MMS_RESPSTATUS_OK: + return "ok"; + case MMS_RESPSTAUTS_ERROR_UNSPECIFIED: + return "unspecified"; + case MMS_RESPSTAUTS_ERROR_SERVICEDENIED: + return "service denied"; + case MMS_RESPSTAUTS_ERROR_MESSAGEFORMATCORRUPT: + return "message format corrupt"; + case MMS_RESPSTAUTS_ERROR_SENDINGADDRESSUNRESOLVED: + return "sending address unresolved"; + case MMS_RESPSTAUTS_ERROR_MESSAGENOTFOUND: + return "message not found"; + case MMS_RESPSTAUTS_ERROR_NETWORKPROBLEM: + return "network problem"; + case MMS_RESPSTAUTS_ERROR_CONTENTNOTACCEPTED: + return "content not accepted"; + case MMS_RESPSTAUTS_ERROR_UNSUPPORTEDMESSAGE: + return "unsupported message"; + case MMS_RESPSTAUTS_ERROR_TRANSIENT_FAILURE: + return "transient failure"; + case MMS_RESPSTAUTS_ERROR_TRANSIENT_SENDING_ADDRESS_UNRESOLVED: + return "transient sending address unresolved"; + case MMS_RESPSTAUTS_ERROR_TRANSIENT_MESSAGE_NOT_FOUND: + return "transient message not found"; + case MMS_RESPSTAUTS_ERROR_TRANSIENT_NETWORK_PROBLEM: + return "transient network problem"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_FAILURE: + return "permanent failure"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_SERVICE_DENIED: + return "permanent service denied"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_MESSAGE_FORMAT_CORRUPT: + return "permanent message format corrupt"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_SENDING_ADDRESS_UNRESOLVED: + return "permanent sending address unresolved"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_MESSAGE_NOT_FOUND: + return "permanent message not found"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_CONTENT_NOT_ACCEPTED: + return "permanent content not accepted"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_REPLY_CHARGING_LIMITATIONS_NOT_MET: + return "permanent reply charging limitations not met"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_REPLY_CHARGING_REQUEST_NOT_ACCEPTED: + return "permanent reply charging request not accepted"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_REPLY_CHARGING_FORWARDING_DENIED: + return "permanent reply charging forwarding denied"; + case MMS_RESPSTAUTS_ERROR_PERMANENT_REPLY_CHARGING_NOT_SUPPORTED: + return "permanent reply charging not supported"; + } + + return MmsDebugPrintUnknownValue(responseStatus); +} + + +const char *MmsDebugGetRetrieveStatus(MmsRetrieveStatus retrieveStatus) +{ + switch (retrieveStatus) { + case MMS_RETRSTATUS_ERROR: + return "error"; + case MMS_RETRSTATUS_OK: + return "ok"; + case MMS_RETRSTATUS_TRANSIENT_FAILURE: + return "transient failure"; + case MMS_RETRSTATUS_TRANSIENT_MESSAGE_NOT_FOUND: + return "transient message not found"; + case MMS_RETRSTATUS_TRANSIENT_NETWORK_PROBLEM: + return "transient network problem"; + case MMS_RETRSTATUS_PERMANENT_FAILURE: + return "permanent failure"; + case MMS_RETRSTATUS_PERMANENT_SERVICE_DENIED: + return "permanent service denied"; + case MMS_RETRSTATUS_PERMANENT_MESSAGE_NOT_FOUND: + return "permanent message not found"; + case MMS_RETRSTATUS_PERMANENT_CONTENT_UNSUPPORT: + return "permanent content unsupport"; + } + + return MmsDebugPrintUnknownValue(retrieveStatus); +} + + +const char *MmsDebugGetMsgStatus(msg_delivery_report_status_t msgStatus) +{ + switch (msgStatus) { + case MSG_DELIVERY_REPORT_ERROR: + return "error"; + case MSG_DELIVERY_REPORT_EXPIRED: + return "expired"; + case MSG_DELIVERY_REPORT_SUCCESS: + return "retrieved"; + case MSG_DELIVERY_REPORT_REJECTED: + return "rejected"; + case MSG_DELIVERY_REPORT_DEFERRED: + return "deferred"; + case MSG_DELIVERY_REPORT_UNRECOGNISED: + return "unrecognised"; + case MSG_DELIVERY_REPORT_INDETERMINATE: + return "indeterminate"; + case MSG_DELIVERY_REPORT_FORWARDED: + return "forwarded"; + case MSG_DELIVERY_REPORT_UNREACHABLE: + return "unreachable"; + } + + return MmsDebugPrintUnknownValue(msgStatus); +} + + +const char *MmsDebugGetMsgClass(MmsMsgClass msgClass) +{ + switch (msgClass) { + case MMS_MSGCLASS_ERROR: + return "error"; + case MMS_MSGCLASS_PERSONAL: + return "personal"; + case MMS_MSGCLASS_ADVERTISEMENT: + return "advertisement"; + case MMS_MSGCLASS_INFORMATIONAL: + return "information"; + case MMS_MSGCLASS_AUTO: + return "auto"; + } + + return MmsDebugPrintUnknownValue(msgClass); +} + + +const char *MmsDebugGetDataType(MmsDataType dataType) +{ + switch (dataType) { + case MMS_DATATYPE_NONE: + return "MMS_DATATYPE_NONE"; + case MMS_DATATYPE_READ: + return "MMS_DATATYPE_READ"; + case MMS_DATATYPE_SENT: + return "MMS_DATATYPE_SENT"; + case MMS_DATATYPE_NOTIFY: + return "MMS_DATATYPE_NOTIFY"; + case MMS_DATATYPE_UNSENT: + return "MMS_DATATYPE_UNSENT"; + case MMS_DATATYPE_DRAFT: + return "MMS_DATATYPE_DRAFT"; + case MMS_DATATYPE_SENDING: + return "MMS_DATATYPE_SENDING"; + case MMS_DATATYPE_DRM_RO_WAITING: + return "MMS_DATATYPE_DRM_RO_WAITING"; + case MMS_DATATYPE_RETRIEVING: + return "MMS_DATATYPE_RETRIEVING"; + case MMS_DATATYPE_UNRETV: + return "MMS_DATATYPE_UNRETV"; + default: + return MmsDebugPrintUnknownValue(dataType); + } +} + +bool MmsInitMsgType(MsgType *pMsgType) +{ + MSG_DEBUG("MmsInitMsgType"); + pMsgType->offset = 0; + pMsgType->size = 0; + pMsgType->contentSize = 0; + pMsgType->disposition = -1; + pMsgType->encoding = -1; + pMsgType->type = MIME_UNKNOWN; + pMsgType->section = -1; + + pMsgType->szOrgFilePath[0] = '\0'; + pMsgType->szContentID[0] = '\0'; + pMsgType->szContentLocation[0] = '\0'; + + pMsgType->szContentRepPos[0] = '\0'; + pMsgType->szContentRepSize[0] = '\0'; + pMsgType->szContentRepIndex[0] = '\0'; + + MmsInitMsgContentParam(&pMsgType->param); +#ifdef __SUPPORT_DRM__ + MmsInitMsgDRMInfo(&pMsgType->drmInfo); +#endif + + return true; +} + +bool MmsInitMsgBody(MsgBody *pMsgBody) +{ + MSG_DEBUG("MmsInitMsgBody"); + pMsgBody->offset = 0; + pMsgBody->size = 0; + pMsgBody->body.pText = NULL; + + MmsInitMsgType(&pMsgBody->presentationType); + pMsgBody->pPresentationBody = NULL; + + memset(pMsgBody->szOrgFilePath, 0, MSG_FILEPATH_LEN_MAX); + + return true; +} + +bool MmsInitMsgContentParam(MsgContentParam *pMsgContentParam) +{ + MSG_DEBUG("MmsInitMsgContentParam"); + pMsgContentParam->charset = MSG_CHARSET_UNKNOWN; + pMsgContentParam->type = MIME_UNKNOWN; + pMsgContentParam->szBoundary[0] = '\0'; + pMsgContentParam->szFileName[0] = '\0'; + pMsgContentParam->szName[0] = '\0'; + pMsgContentParam->szStart[0] = '\0'; + pMsgContentParam->szStartInfo[0] = '\0'; + pMsgContentParam->pPresentation = NULL; + pMsgContentParam->reportType = MSG_PARAM_REPORT_TYPE_UNKNOWN; // only used as parameter of Content-Type: multipart/report; report-type +#ifdef FEATURE_JAVA_MMS + pMsgContentParam->szApplicationID = NULL; + pMsgContentParam->szReplyToApplicationID = NULL; +#endif + return true; +} + +bool MmsInitMsgAttrib(MmsAttrib *pAttrib) +{ + MSG_DEBUG("MmsInitMsgAttrib"); + + pAttrib->bAskDeliveryReport = false; + + pAttrib->bAskReadReply = false; + pAttrib->bRead = false; + pAttrib->bReportAllowed = false; + pAttrib->readReportAllowedType = MMS_RECEIVE_READ_REPORT_ALLOWED; + pAttrib->readReportSendStatus = MMS_RECEIVE_READ_REPORT_NO_SEND; + pAttrib->bReadReportSent = false; + + pAttrib->bHideAddress = false; + pAttrib->date = 0; + pAttrib->bUseDeliveryCustomTime = false; + pAttrib->deliveryTime.type = MMS_TIMETYPE_RELATIVE; + pAttrib->deliveryTime.time = 0; + pAttrib->bUseExpiryCustomTime = false; + pAttrib->expiryTime.type = MMS_TIMETYPE_RELATIVE; + pAttrib->expiryTime.time = 0; + memset(&pAttrib->expiryTime, 0, sizeof(MmsTimeStruct)); + pAttrib->msgClass = MMS_MSGCLASS_PERSONAL; + pAttrib->msgStatus = MSG_DELIVERY_REPORT_NONE; + pAttrib->priority = MMS_PRIORITY_NORMAL; + pAttrib->responseStatus = MMS_RESPSTATUS_ERROR; + pAttrib->retrieveStatus = MMS_RETRSTATUS_ERROR; + pAttrib->contentType = MIME_UNKNOWN; + pAttrib->msgSize = 0; + pAttrib->bLeaveCopy = true; + + pAttrib->specialMsgType = MMS_SPECIAL_MSG_TYPE_NONE; +#ifdef __SUPPORT_DRM__ + pAttrib->drmType = MSG_DRM_TYPE_NONE; + pAttrib->roWaitingTimerMax = 0; + pAttrib->pszDrmData = NULL; +#endif + pAttrib->version = MMS_VERSION; + + memset(pAttrib->szFrom, 0, MSG_LOCALE_ADDR_LEN + 10); + memset(pAttrib->szResponseText, 0, MMS_LOCALE_RESP_TEXT_LEN + 1); + memset(pAttrib->szRetrieveText, 0, MMS_LOCALE_RESP_TEXT_LEN + 1); + memset(pAttrib->szSubject, 0, MSG_LOCALE_SUBJ_LEN + 1); + pAttrib->szTo = NULL; + pAttrib->szCc = NULL; + pAttrib->szBcc = NULL; + + pAttrib->pMultiStatus = NULL; + + pAttrib->replyCharge.chargeType = MMS_REPLY_NONE; + memset(&pAttrib->replyCharge.deadLine , 0, sizeof(MmsTimeStruct)); + pAttrib->replyCharge.chargeSize = 0; + memset(pAttrib->replyCharge.szChargeID, 0, MMS_MSG_ID_LEN); + + return true; +} + +#ifdef __SUPPORT_DRM__ +bool MmsInitMsgDRMInfo(MsgDRMInfo *pMsgDrmInfo) +{ + pMsgDrmInfo->contentType = MIME_UNKNOWN; + pMsgDrmInfo->drmType = MSG_DRM_TYPE_NONE; + + pMsgDrmInfo->szContentName = NULL; + pMsgDrmInfo->szContentURI = NULL; + pMsgDrmInfo->szContentDescription = NULL; + pMsgDrmInfo->szContentVendor = NULL; + pMsgDrmInfo->szRightIssuer = NULL; + pMsgDrmInfo->szDrm2FullPath = NULL; + pMsgDrmInfo->roWaitingTimerMax = 0; + pMsgDrmInfo->bFwdLock = false; + pMsgDrmInfo->bNoScreen = false; + pMsgDrmInfo->bNoRingTone = false; + pMsgDrmInfo->pszContentType = NULL; + + return true; +} +#endif diff --git a/plugin/mms_plugin/MmsPluginConnManWrapper.cpp b/plugin/mms_plugin/MmsPluginConnManWrapper.cpp index f0413a6..860bc1a 100755 --- a/plugin/mms_plugin/MmsPluginConnManWrapper.cpp +++ b/plugin/mms_plugin/MmsPluginConnManWrapper.cpp @@ -15,6 +15,7 @@ */ #include "MmsPluginConnManWrapper.h" +#include "MmsPluginDebug.h" void network_print_profile(net_profile_info_t *ProfInfo) { diff --git a/plugin/mms_plugin/MmsPluginDebug.cpp b/plugin/mms_plugin/MmsPluginDebug.cpp deleted file mode 100755 index 3562aa7..0000000 --- a/plugin/mms_plugin/MmsPluginDebug.cpp +++ /dev/null @@ -1,549 +0,0 @@ -/* -* Copyright 2012 Samsung Electronics Co., Ltd -* -* Licensed under the Flora License, Version 1.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.tizenopensource.org/license -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#include -#include "MmsPluginMIME.h" -#include "MmsPluginMessage.h" - -static char gszDebugStringBuf[50]; - -static char *MmsDebugPrintUnknownValue(int value) -{ - printf(gszDebugStringBuf, "unknown value(%d)", value); - return gszDebugStringBuf; -} - - -const char *MmsDebugGetMimeType(MimeType mimeType) -{ - switch (mimeType) { - case MIME_APPLICATION_XML: - return "MIME_APPLICATION_XML"; - case MIME_APPLICATION_WML_XML: - return "MIME_APPLICATION_WML_XML"; - case MIME_APPLICATION_XHTML_XML: - return "MIME_APPLICATION_XHTML_XML"; - case MIME_APPLICATION_JAVA_VM: - return "MIME_APPLICATION_JAVA_VM"; - case MIME_APPLICATION_SMIL: - return "MIME_APPLICATION_SMIL"; - case MIME_APPLICATION_JAVA_ARCHIVE: - return "MIME_APPLICATION_JAVA_ARCHIVE"; - case MIME_APPLICATION_JAVA: - return "MIME_APPLICATION_JAVA"; - case MIME_APPLICATION_OCTET_STREAM: - return "MIME_APPLICATION_OCTET_STREAM"; - case MIME_APPLICATION_STUDIOM: - return "MIME_APPLICATION_STUDIOM"; - case MIME_APPLICATION_FUNMEDIA: - return "MIME_APPLICATION_FUNMEDIA"; - case MIME_APPLICATION_MSWORD: - return "MIME_APPLICATION_MSWORD"; - case MIME_APPLICATION_PDF: - return "MIME_APPLICATION_PDF"; - case MIME_APPLICATION_ASTERIC: - return "MIME_APPLICATION_ASTERIC"; - case MIME_APPLICATION_VND_WAP_XHTMLXML: - return "MIME_APPLICATION_VND_WAP_XHTMLXML"; - case MIME_APPLICATION_VND_WAP_WMLC: - return "MIME_APPLICATION_VND_WAP_WMLC"; - case MIME_APPLICATION_VND_WAP_WMLSCRIPTC: - return "MIME_APPLICATION_VND_WAP_WMLSCRIPTC"; - case MIME_APPLICATION_VND_WAP_WTA_EVENTC: - return "MIME_APPLICATION_VND_WAP_WTA_EVENTC"; - case MIME_APPLICATION_VND_WAP_UAPROF: - return "MIME_APPLICATION_VND_WAP_UAPROF"; - case MIME_APPLICATION_VND_WAP_SIC: - return "MIME_APPLICATION_VND_WAP_SIC"; - case MIME_APPLICATION_VND_WAP_SLC: - return "MIME_APPLICATION_VND_WAP_SLC"; - case MIME_APPLICATION_VND_WAP_COC: - return "MIME_APPLICATION_VND_WAP_COC"; - case MIME_APPLICATION_VND_WAP_SIA: - return "MIME_APPLICATION_VND_WAP_SIA"; - case MIME_APPLICATION_VND_WAP_CONNECTIVITY_WBXML: - return "MIME_APPLICATION_VND_WAP_CONNECTIVITY_WBXML"; - case MIME_APPLICATION_VND_WAP_MULTIPART_FORM_DATA: - return "MIME_APPLICATION_VND_WAP_MULTIPART_FORM_DATA"; - case MIME_APPLICATION_VND_WAP_MULTIPART_BYTERANGES: - return "MIME_APPLICATION_VND_WAP_MULTIPART_BYTERANGES"; - case MIME_APPLICATION_VND_WAP_MULTIPART_MIXED: - return "MIME_APPLICATION_VND_WAP_MULTIPART_MIXED"; - case MIME_APPLICATION_VND_WAP_MULTIPART_RELATED: - return "MIME_APPLICATION_VND_WAP_MULTIPART_RELATED"; - case MIME_APPLICATION_VND_WAP_MULTIPART_ALTERNATIVE: - return "MIME_APPLICATION_VND_WAP_MULTIPART_ALTERNATIVE"; - case MIME_APPLICATION_VND_WAP_MULTIPART_ASTERIC: - return "MIME_APPLICATION_VND_WAP_MULTIPART_ASTERIC"; - case MIME_APPLICATION_VND_OMA_DD_XML: - return "MIME_APPLICATION_VND_OMA_DD_XML"; - case MIME_APPLICATION_VND_OMA_DRM_MESSAGE: - return "MIME_APPLICATION_VND_OMA_DRM_MESSAGE"; - case MIME_APPLICATION_VND_OMA_DRM_CONTENT: - return "MIME_APPLICATION_VND_OMA_DRM_CONTENT"; - case MIME_APPLICATION_VND_OMA_DRM_RIGHTS_XML: - return "MIME_APPLICATION_VND_OMA_DRM_RIGHTS_XML"; - case MIME_APPLICATION_VND_OMA_DRM_RIGHTS_WBXML: - return "MIME_APPLICATION_VND_OMA_DRM_RIGHTS_WBXML"; - case MIME_APPLICATION_VND_SMAF: - return "MIME_APPLICATION_VND_SMAF"; - case MIME_APPLICATION_VND_RN_REALMEDIA: - return "MIME_APPLICATION_VND_RN_REALMEDIA"; - case MIME_APPLICATION_VND_SUN_J2ME_JAVA_ARCHIVE: - return "MIME_APPLICATION_VND_SUN_J2ME_JAVA_ARCHIVE"; - case MIME_APPLICATION_VND_SAMSUNG_THEME: - return "MIME_APPLICATION_VND_SAMSUNG_THEME"; - case MIME_APPLICATION_VND_EXCEL: - return "MIME_APPLICATION_VND_EXCEL"; - case MIME_APPLICATION_X_HDMLC: - return "MIME_APPLICATION_X_HDMLC"; - case MIME_APPLICATION_X_X968_USERCERT: - return "MIME_APPLICATION_X_X968_USERCERT"; - case MIME_APPLICATION_X_WWW_FORM_URLENCODED: - return "MIME_APPLICATION_X_WWW_FORM_URLENCODED"; - case MIME_APPLICATION_X_SMAF: - return "MIME_APPLICATION_X_SMAF"; - case MIME_APPLICATION_X_FLASH: - return "MIME_APPLICATION_X_FLASH"; - case MIME_APPLICATION_X_EXCEL: - return "MIME_APPLICATION_X_EXCEL"; - case MIME_APPLICATION_X_POWERPOINT: - return "MIME_APPLICATION_X_POWERPOINT"; - - case MIME_AUDIO_BASIC: - return "MIME_AUDIO_BASIC"; - case MIME_AUDIO_MPEG: - return "MIME_AUDIO_MPEG"; - case MIME_AUDIO_MP3: - return "MIME_AUDIO_MP3"; - case MIME_AUDIO_MPG3: - return "MIME_AUDIO_MPG3"; - case MIME_AUDIO_MPEG3: - return "MIME_AUDIO_MPEG3"; - case MIME_AUDIO_MPG: - return "MIME_AUDIO_MPG"; - case MIME_AUDIO_AAC: - return "MIME_AUDIO_AAC"; - case MIME_AUDIO_G72: - return "MIME_AUDIO_G72"; - case MIME_AUDIO_AMR: - return "MIME_AUDIO_AMR"; - case MIME_AUDIO_AMR_WB: - return "MIME_AUDIO_AMR_WB"; - case MIME_AUDIO_MMF: - return "MIME_AUDIO_MMF"; - case MIME_AUDIO_SMAF: - return "MIME_AUDIO_SMAF"; - case MIME_AUDIO_IMELODY: - return "MIME_AUDIO_IMELODY"; - case MIME_AUDIO_MELODY: - return "MIME_AUDIO_MELODY"; - case MIME_AUDIO_MID: - return "MIME_AUDIO_MID"; - case MIME_AUDIO_MIDI: - return "MIME_AUDIO_MIDI"; - case MIME_AUDIO_X_MID: - return "MIME_AUDIO_X_MID"; - case MIME_AUDIO_SP_MIDI: - return "MIME_AUDIO_SP_MIDI"; - case MIME_AUDIO_WAVE: - return "MIME_AUDIO_WAVE"; - case MIME_AUDIO_3GPP: - return "MIME_AUDIO_3GPP"; - case MIME_AUDIO_MP4: - return "MIME_AUDIO_MP4"; - case MIME_AUDIO_MP4A_LATM: - return "MIME_AUDIO_MP4A_LATM"; - case MIME_AUDIO_VND_RN_REALAUDIO: - return "MIME_AUDIO_VND_RN_REALAUDIO"; - case MIME_AUDIO_X_MPEG: - return "MIME_AUDIO_X_MPEG"; - case MIME_AUDIO_X_MP3: - return "MIME_AUDIO_X_MP3"; - case MIME_AUDIO_X_MPEG3: - return "MIME_AUDIO_X_MPEG3"; - case MIME_AUDIO_X_MPG: - return "MIME_AUDIO_X_MPG"; - case MIME_AUDIO_X_AMR: - return "MIME_AUDIO_X_AMR"; - case MIME_AUDIO_X_MMF: - return "MIME_AUDIO_X_MMF"; - case MIME_AUDIO_X_SMAF: - return "MIME_AUDIO_X_SMAF"; - case MIME_AUDIO_X_IMELODY: - return "MIME_AUDIO_X_IMELODY"; - case MIME_AUDIO_X_MIDI: - return "MIME_AUDIO_X_MIDI"; - case MIME_AUDIO_X_MPEGAUDIO: - return "MIME_AUDIO_X_MPEGAUDIO"; - case MIME_AUDIO_X_PN_REALAUDIO: - return "MIME_AUDIO_X_PN_REALAUDIO"; - case MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO: - return "MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO"; - case MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO_LIVE: - return "MIME_AUDIO_X_PN_MULTIRATE_REALAUDIO_LIVE"; - case MIME_AUDIO_X_WAV: - return "MIME_AUDIO_X_WAV"; - - case MIME_IMAGE_GIF: - return "MIME_IMAGE_GIF"; - case MIME_IMAGE_JPEG: - return "MIME_IMAGE_JPEG"; - case MIME_IMAGE_JPG: - return "MIME_IMAGE_JPG"; - case MIME_IMAGE_TIFF: - return "MIME_IMAGE_TIFF"; - case MIME_IMAGE_TIF: - return "MIME_IMAGE_TIF"; - case MIME_IMAGE_PNG: - return "MIME_IMAGE_PNG"; - case MIME_IMAGE_WBMP: - return "MIME_IMAGE_WBMP"; - case MIME_IMAGE_PJPEG: - return "MIME_IMAGE_PJPEG"; - case MIME_IMAGE_BMP: - return "MIME_IMAGE_BMP"; - case MIME_IMAGE_SVG: - return "MIME_IMAGE_SVG"; - case MIME_IMAGE_SVG1: - return "MIME_IMAGE_SVG1"; - case MIME_IMAGE_VND_WAP_WBMP: - return "MIME_IMAGE_VND_WAP_WBMP"; - - case MIME_IMAGE_X_BMP: - return "MIME_IMAGE_X_BMP"; - - case MIME_MESSAGE_RFC822: - return "MIME_MESSAGE_RFC822"; - - case MIME_MULTIPART_MIXED: - return "MIME_MULTIPART_MIXED"; - case MIME_MULTIPART_RELATED: - return "MIME_MULTIPART_RELATED"; - case MIME_MULTIPART_ALTERNATIVE: - return "MIME_MULTIPART_ALTERNATIVE"; - case MIME_MULTIPART_FORM_DATA: - return "MIME_MULTIPART_FORM_DATA"; - case MIME_MULTIPART_BYTERANGE: - return "MIME_MULTIPART_BYTERANGE"; - case MIME_MULTIPART_REPORT: - return "MIME_MULTIPART_REPORT"; - - case MIME_TEXT_TXT: - return "MIME_TEXT_TXT"; - case MIME_TEXT_HTML: - return "MIME_TEXT_HTML"; - case MIME_TEXT_PLAIN: - return "MIME_TEXT_PLAIN"; - case MIME_TEXT_CSS: - return "MIME_TEXT_CSS"; - case MIME_TEXT_XML: - return "MIME_TEXT_XML"; - case MIME_TEXT_IMELODY: - return "MIME_TEXT_IMELODY"; - case MIME_TEXT_VND_WAP_WMLSCRIPT: - return "MIME_TEXT_VND_WAP_WMLSCRIPT"; - case MIME_TEXT_VND_WAP_WML: - return "MIME_TEXT_VND_WAP_WML"; - case MIME_TEXT_VND_WAP_WTA_EVENT: - return "MIME_TEXT_VND_WAP_WTA_EVENT"; - case MIME_TEXT_VND_WAP_CONNECTIVITY_XML: - return "MIME_TEXT_VND_WAP_CONNECTIVITY_XML"; - case MIME_TEXT_VND_WAP_SI: - return "MIME_TEXT_VND_WAP_SI"; - case MIME_TEXT_VND_WAP_SL: - return "MIME_TEXT_VND_WAP_SL"; - case MIME_TEXT_VND_WAP_CO: - return "MIME_TEXT_VND_WAP_CO"; - case MIME_TEXT_VND_SUN_J2ME_APP_DESCRIPTOR: - return "MIME_TEXT_VND_SUN_J2ME_APP_DESCRIPTOR"; - case MIME_TEXT_X_HDML: - return "MIME_TEXT_X_HDML"; - case MIME_TEXT_X_VCALENDAR: - return "MIME_TEXT_X_VCALENDAR"; - case MIME_TEXT_X_VCARD: - return "MIME_TEXT_X_VCARD"; - case MIME_TEXT_X_IMELODY: - return "MIME_TEXT_X_IMELODY"; - - case MIME_VIDEO_MPEG4: - return "MIME_VIDEO_MPEG4"; - case MIME_VIDEO_MP4: - return "MIME_VIDEO_MP4"; - case MIME_VIDEO_H263: - return "MIME_VIDEO_H263"; - case MIME_VIDEO_3GPP: - return "MIME_VIDEO_3GPP"; - case MIME_VIDEO_3GP: - return "MIME_VIDEO_3GP"; - case MIME_VIDEO_AVI: - return "MIME_VIDEO_AVI"; - case MIME_VIDEO_SDP: - return "MIME_VIDEO_SDP"; - case MIME_VIDEO_VND_RN_REALVIDEO: - return "MIME_VIDEO_VND_RN_REALVIDEO"; - case MIME_VIDEO_X_MP4: - return "MIME_VIDEO_X_MP4"; - case MIME_VIDEO_X_PV_MP4: - return "MIME_VIDEO_X_PV_MP4"; - case MIME_VIDEO_X_PN_REALVIDEO: - return "MIME_VIDEO_X_PN_REALVIDEO"; - case MIME_VIDEO_X_PN_MULTIRATE_REALVIDEO: - return "MIME_VIDEO_X_PN_MULTIRATE_REALVIDEO"; - default: - return MmsDebugPrintUnknownValue(mimeType); - } -} - - -/* MsgMmsMsg.h */ -const char *MmsDebugGetMmsReport(MmsReport report) -{ - switch (report) { - case MMS_REPORT_ERROR: - return "MMS_REPORT_ERROR"; - case MMS_REPORT_YES: - return "MMS_REPORT_YES"; - case MMS_REPORT_NO: - return "MMS_REPORT_NO"; - } - - return MmsDebugPrintUnknownValue(report); -} - - -const char *MmsDebugGetMmsReportAllowed(MmsReportAllowed reportAllowed) -{ - switch (reportAllowed) { - case MMS_REPORTALLOWED_ERROR: - return "MMS_REPORTALLOWED_ERROR"; - case MMS_REPORTALLOWED_YES: - return "MMS_REPORTALLOWED_YES"; - case MMS_REPORTALLOWED_NO: - return "MMS_REPORTALLOWED_NO"; - } - - return MmsDebugPrintUnknownValue(reportAllowed); -} - - -const char *MmsDebugGetMmsReadStatus(msg_read_report_status_t readStatus) -{ - _MSG_READ_REPORT_STATUS_E readReport = (_MSG_READ_REPORT_STATUS_E)readStatus; - - switch (readReport) { - case MSG_READ_REPORT_NONE: - return "MMS_READSTATUS_NONE"; - case MSG_READ_REPORT_IS_READ: - return "MMS_IS_READ"; - case MSG_READ_REPORT_IS_DELETED: - return "MMS_IS_DELETED"; - } - - return MmsDebugPrintUnknownValue(readStatus); -} - -const char *MmsDebugGetMsgType(MmsMsgType msgType) -{ - switch (msgType) { - case MMS_MSGTYPE_ERROR: - return "error"; - case MMS_MSGTYPE_SEND_REQ: - return "send.req"; - case MMS_MSGTYPE_SEND_CONF: - return "send.conf"; - case MMS_MSGTYPE_NOTIFICATION_IND: - return "notification.ind"; - case MMS_MSGTYPE_NOTIFYRESP_IND: - return "notifyResp.ind"; - case MMS_MSGTYPE_RETRIEVE_CONF: - return "retrieve conf"; - case MMS_MSGTYPE_ACKNOWLEDGE_IND: - return "acknowledge ind"; - case MMS_MSGTYPE_DELIVERY_IND: - return "delivery ind"; - case MMS_MSGTYPE_READREC_IND: - return "read rec ind"; - case MMS_MSGTYPE_READORG_IND: - return "read org ind"; - case MMS_MSGTYPE_FORWARD_REQ: - return "forward req"; - case MMS_MSGTYPE_FORWARD_CONF: - return "forward conf"; - case MMS_MSGTYPE_READ_REPLY: - return "read reply"; - default: - return MmsDebugPrintUnknownValue(msgType); - } -} - -const char *MmsDebugGetResponseStatus(MmsResponseStatus responseStatus) -{ - switch (responseStatus) { - case MMS_RESPSTATUS_ERROR: - return "error"; - case MMS_RESPSTATUS_OK: - return "ok"; - case MMS_RESPSTAUTS_ERROR_UNSPECIFIED: - return "unspecified"; - case MMS_RESPSTAUTS_ERROR_SERVICEDENIED: - return "service denied"; - case MMS_RESPSTAUTS_ERROR_MESSAGEFORMATCORRUPT: - return "message format corrupt"; - case MMS_RESPSTAUTS_ERROR_SENDINGADDRESSUNRESOLVED: - return "sending address unresolved"; - case MMS_RESPSTAUTS_ERROR_MESSAGENOTFOUND: - return "message not found"; - case MMS_RESPSTAUTS_ERROR_NETWORKPROBLEM: - return "network problem"; - case MMS_RESPSTAUTS_ERROR_CONTENTNOTACCEPTED: - return "content not accepted"; - case MMS_RESPSTAUTS_ERROR_UNSUPPORTEDMESSAGE: - return "unsupported message"; - case MMS_RESPSTAUTS_ERROR_TRANSIENT_FAILURE: - return "transient failure"; - case MMS_RESPSTAUTS_ERROR_TRANSIENT_SENDING_ADDRESS_UNRESOLVED: - return "transient sending address unresolved"; - case MMS_RESPSTAUTS_ERROR_TRANSIENT_MESSAGE_NOT_FOUND: - return "transient message not found"; - case MMS_RESPSTAUTS_ERROR_TRANSIENT_NETWORK_PROBLEM: - return "transient network problem"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_FAILURE: - return "permanent failure"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_SERVICE_DENIED: - return "permanent service denied"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_MESSAGE_FORMAT_CORRUPT: - return "permanent message format corrupt"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_SENDING_ADDRESS_UNRESOLVED: - return "permanent sending address unresolved"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_MESSAGE_NOT_FOUND: - return "permanent message not found"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_CONTENT_NOT_ACCEPTED: - return "permanent content not accepted"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_REPLY_CHARGING_LIMITATIONS_NOT_MET: - return "permanent reply charging limitations not met"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_REPLY_CHARGING_REQUEST_NOT_ACCEPTED: - return "permanent reply charging request not accepted"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_REPLY_CHARGING_FORWARDING_DENIED: - return "permanent reply charging forwarding denied"; - case MMS_RESPSTAUTS_ERROR_PERMANENT_REPLY_CHARGING_NOT_SUPPORTED: - return "permanent reply charging not supported"; - } - - return MmsDebugPrintUnknownValue(responseStatus); -} - - -const char *MmsDebugGetRetrieveStatus(MmsRetrieveStatus retrieveStatus) -{ - switch (retrieveStatus) { - case MMS_RETRSTATUS_ERROR: - return "error"; - case MMS_RETRSTATUS_OK: - return "ok"; - case MMS_RETRSTATUS_TRANSIENT_FAILURE: - return "transient failure"; - case MMS_RETRSTATUS_TRANSIENT_MESSAGE_NOT_FOUND: - return "transient message not found"; - case MMS_RETRSTATUS_TRANSIENT_NETWORK_PROBLEM: - return "transient network problem"; - case MMS_RETRSTATUS_PERMANENT_FAILURE: - return "permanent failure"; - case MMS_RETRSTATUS_PERMANENT_SERVICE_DENIED: - return "permanent service denied"; - case MMS_RETRSTATUS_PERMANENT_MESSAGE_NOT_FOUND: - return "permanent message not found"; - case MMS_RETRSTATUS_PERMANENT_CONTENT_UNSUPPORT: - return "permanent content unsupport"; - } - - return MmsDebugPrintUnknownValue(retrieveStatus); -} - - -const char *MmsDebugGetMsgStatus(msg_delivery_report_status_t msgStatus) -{ - switch (msgStatus) { - case MSG_DELIVERY_REPORT_ERROR: - return "error"; - case MSG_DELIVERY_REPORT_EXPIRED: - return "expired"; - case MSG_DELIVERY_REPORT_SUCCESS: - return "retrieved"; - case MSG_DELIVERY_REPORT_REJECTED: - return "rejected"; - case MSG_DELIVERY_REPORT_DEFERRED: - return "deferred"; - case MSG_DELIVERY_REPORT_UNRECOGNISED: - return "unrecognised"; - case MSG_DELIVERY_REPORT_INDETERMINATE: - return "indeterminate"; - case MSG_DELIVERY_REPORT_FORWARDED: - return "forwarded"; - case MSG_DELIVERY_REPORT_UNREACHABLE: - return "unreachable"; - } - - return MmsDebugPrintUnknownValue(msgStatus); -} - - -const char *MmsDebugGetMsgClass(MmsMsgClass msgClass) -{ - switch (msgClass) { - case MMS_MSGCLASS_ERROR: - return "error"; - case MMS_MSGCLASS_PERSONAL: - return "personal"; - case MMS_MSGCLASS_ADVERTISEMENT: - return "advertisement"; - case MMS_MSGCLASS_INFORMATIONAL: - return "information"; - case MMS_MSGCLASS_AUTO: - return "auto"; - } - - return MmsDebugPrintUnknownValue(msgClass); -} - - -const char *MmsDebugGetDataType(MmsDataType dataType) -{ - switch (dataType) { - case MMS_DATATYPE_NONE: - return "MMS_DATATYPE_NONE"; - case MMS_DATATYPE_READ: - return "MMS_DATATYPE_READ"; - case MMS_DATATYPE_SENT: - return "MMS_DATATYPE_SENT"; - case MMS_DATATYPE_NOTIFY: - return "MMS_DATATYPE_NOTIFY"; - case MMS_DATATYPE_UNSENT: - return "MMS_DATATYPE_UNSENT"; - case MMS_DATATYPE_DRAFT: - return "MMS_DATATYPE_DRAFT"; - case MMS_DATATYPE_SENDING: - return "MMS_DATATYPE_SENDING"; - case MMS_DATATYPE_DRM_RO_WAITING: - return "MMS_DATATYPE_DRM_RO_WAITING"; - case MMS_DATATYPE_RETRIEVING: - return "MMS_DATATYPE_RETRIEVING"; - case MMS_DATATYPE_UNRETV: - return "MMS_DATATYPE_UNRETV"; - default: - return MmsDebugPrintUnknownValue(dataType); - } -} diff --git a/plugin/mms_plugin/MmsPluginDecode.cpp b/plugin/mms_plugin/MmsPluginDecode.cpp index e70258b..3a1c39a 100755 --- a/plugin/mms_plugin/MmsPluginDecode.cpp +++ b/plugin/mms_plugin/MmsPluginDecode.cpp @@ -20,22 +20,24 @@ #include #include -#include "MsgDebug.h" -#include "MsgException.h" +#include "MsgUtilFile.h" + +#include "MmsPluginDebug.h" #include "MmsPluginDecode.h" #include "MmsPluginCodecCommon.h" #include "MmsPluginStorage.h" -#include "MsgUtilFile.h" #include "MmsPluginDebug.h" -#include "MsgSettingTypes.h" +#include "MmsPluginMIME.h" #include "MmsPluginAvCodec.h" #include "MmsPluginSmil.h" +#include "MmsPluginTextConvert.h" +#include "MmsPluginUtil.h" + #ifdef __SUPPORT_DRM__ #include "MmsPluginDrm.h" #include "MsgDrmWrapper.h" #endif -#include "MmsPluginTextConvert.h" -#include "MmsPluginUtil.h" + /*Decode wsp*/ static int __MmsGetDecodeOffset(void); @@ -5118,7 +5120,7 @@ static bool __MsgInitMsgType(MsgType *pMsgType) __MsgInitMsgContentParam(&pMsgType->param); #ifdef __SUPPORT_DRM__ - __MsgInitMsgDRMInfo(&pMsgType->drmInfo); + MmsInitMsgDRMInfo(&pMsgType->drmInfo); #endif return true; diff --git a/plugin/mms_plugin/MmsPluginDrm.cpp b/plugin/mms_plugin/MmsPluginDrm.cpp index 6718795..d9d0c7f 100755 --- a/plugin/mms_plugin/MmsPluginDrm.cpp +++ b/plugin/mms_plugin/MmsPluginDrm.cpp @@ -17,11 +17,12 @@ #include #include #include -#include "MmsPluginDrm.h" -#include "MmsPluginCodec.h" #include "MsgMmsTypes.h" #include "MsgDrmWrapper.h" -#include "MsgDebug.h" +#include "MmsPluginDrm.h" +#include "MmsPluginCodec.h" +#include "MmsPluginMIME.h" +#include "MmsPluginDebug.h" #include "MmsPluginUtil.h" #ifdef __SUPPORT_DRM__ diff --git a/plugin/mms_plugin/MmsPluginEncode.cpp b/plugin/mms_plugin/MmsPluginEncode.cpp index 2d94a49..0fcb473 100755 --- a/plugin/mms_plugin/MmsPluginEncode.cpp +++ b/plugin/mms_plugin/MmsPluginEncode.cpp @@ -16,15 +16,16 @@ #include #include - +#include +#include "MsgUtilFile.h" +#include "MmsPluginDebug.h" #include "MmsPluginEncode.h" #include "MmsPluginCodecTypes.h" #include "MmsPluginCodecCommon.h" -#include "MsgDebug.h" -#include "MsgUtilFile.h" #include "MmsPluginMIME.h" #include "MmsPluginUtil.h" + /** Sending message related variables ------------------------ */ static char gszMmsEncodeBuf[MSG_MMS_ENCODE_BUFFER_MAX] = {0, }; static int gCurMmsEncodeBuffPos = 0; /* number of characters on gpMmsEncodeBuf */ diff --git a/plugin/mms_plugin/MmsPluginEventHandler.cpp b/plugin/mms_plugin/MmsPluginEventHandler.cpp index 4b428ca..87971c7 100755 --- a/plugin/mms_plugin/MmsPluginEventHandler.cpp +++ b/plugin/mms_plugin/MmsPluginEventHandler.cpp @@ -14,21 +14,13 @@ * limitations under the License. */ -#include -#include - -#include "MsgDebug.h" -#include "MsgUtilFile.h" -#include "MsgMmsTypes.h" -#include "MsgSoundPlayer.h" -#include "MsgStorageHandler.h" -#include "MmsPluginTransport.h" +#include +#include + +#include "MmsPluginTypes.h" +#include "MmsPluginDebug.h" #include "MmsPluginEventHandler.h" -#include "MmsPluginCodec.h" #include "MmsPluginInternal.h" -#include "MmsPluginSmil.h" -#include "MsgMmsMessage.h" - /*================================================================================================== IMPLEMENTATION OF SmsPluginEventHandler - Member Functions diff --git a/plugin/mms_plugin/MmsPluginHttp.cpp b/plugin/mms_plugin/MmsPluginHttp.cpp index ad6b731..a625798 100755 --- a/plugin/mms_plugin/MmsPluginHttp.cpp +++ b/plugin/mms_plugin/MmsPluginHttp.cpp @@ -14,12 +14,13 @@ * limitations under the License. */ +#include +#include +#include +#include "MmsPluginDebug.h" #include "MmsPluginHttp.h" #include "MmsPluginUserAgent.h" -#include "stdlib.h" -#include #include "MmsPluginConnManWrapper.h" -#include static bool __httpGetHeaderField(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szHeaderBuffer); static void __httpGetHost(char *szUrl, char *szHost, int nBufferLen); @@ -557,7 +558,7 @@ void MmsPluginHttpAgent::SetMMSProfile() MmsPluginCmAgent::instance()->getHomeURL(mmscConfig->mmscUrl); if (strlen(mmscConfig->mmscUrl) < 1) { - strcpy(mmscConfig->mmscUrl, DEFAULT_MMSC_URL); + MSG_DEBUG("##### get Home URL Error"); } MmsPluginCmAgent::instance()->getProxyAddr(mmscConfig->httpProxyIpAddr); diff --git a/plugin/mms_plugin/MmsPluginInternal.cpp b/plugin/mms_plugin/MmsPluginInternal.cpp index c160d16..2c0bfa8 100755 --- a/plugin/mms_plugin/MmsPluginInternal.cpp +++ b/plugin/mms_plugin/MmsPluginInternal.cpp @@ -18,21 +18,17 @@ #include #include -#include "MsgDebug.h" #include "MsgUtilFile.h" #include "MsgException.h" +#include "MsgSettingTypes.h" #include "MsgMmsMessage.h" -#include "MsgTransportTypes.h" #include "MsgGconfWrapper.h" -#include "MsgSoundPlayer.h" #include "MsgStorageHandler.h" +#include "MmsPluginDebug.h" #include "MmsPluginTypes.h" #include "MmsPluginCodec.h" #include "MmsPluginInternal.h" #include "MmsPluginStorage.h" -#include "MmsPluginHttp.h" -#include "MmsPluginCodec.h" -#include "MsgNotificationWrapper.h" #include "MmsPluginSmil.h" /*================================================================================================== @@ -355,6 +351,17 @@ void MmsPluginInternal::processSendConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTranQEn strncpy(pMsgInfo->msgText, responseText, MMS_LOCALE_RESP_TEXT_LEN); } + MSG_ADDRESS_INFO_S addressinfo = {0,}; + char *msisdn = NULL; + msisdn = MsgSettingGetString(MSG_SIM_MSISDN); + + MmsPluginStorage::instance()->getAddressInfo(pMsgInfo->msgId, &addressinfo); + + MSG_MMS_VLD_INFO("%d, MMS Send End %s->%s %s", pMsgInfo->msgId + , (msisdn == NULL)?"ME":msisdn + , addressinfo.addressVal + , (pMsgInfo->networkStatus == MSG_NETWORK_SEND_SUCCESS)?"Success":"Fail"); + // set message-id from mmsc strncpy(recvData.szMsgID, mmsHeader.szMsgID, MMS_MSG_ID_LEN); strncpy(recvData.szTrID, mmsHeader.szTrID, MMS_TR_ID_LEN); @@ -429,6 +436,17 @@ void MmsPluginInternal::processRetrieveConf(MSG_MESSAGE_INFO_S *pMsgInfo, mmsTra pMsgInfo->msgType.subType = MSG_NOTIFICATIONIND_MMS; } + char *msisdn = NULL; + msisdn = MsgSettingGetString(MSG_SIM_MSISDN); + + if (mmsHeader.pFrom) + MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr); + + MSG_MMS_VLD_INFO("%d, MMS Receive %s End %s->%s %s", pMsgInfo->msgId + , (pRequest->eMmsPduType == eMMS_RETRIEVE_AUTO_CONF)?"Auto":"Manual" + , (mmsHeader.pFrom)?mmsHeader.pFrom->szAddr:"YOU" + , (msisdn == NULL)?"ME":msisdn + , (pMsgInfo->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS)?"Success":"Fail"); pMsgInfo->dataSize = pRequest->getDataLen; // set message-id & MMS TPDU file path diff --git a/plugin/mms_plugin/MmsPluginMIME.cpp b/plugin/mms_plugin/MmsPluginMIME.cpp index bb0fe73..c0a7b6d 100755 --- a/plugin/mms_plugin/MmsPluginMIME.cpp +++ b/plugin/mms_plugin/MmsPluginMIME.cpp @@ -17,9 +17,9 @@ #include #include #include "MmsPluginMIME.h" -#include "MsgDebug.h" - +#include "MmsPluginDebug.h" #include "MmsPluginSmil.h" + #ifndef NULL #define NULL 0 #endif diff --git a/plugin/mms_plugin/MmsPluginMain.cpp b/plugin/mms_plugin/MmsPluginMain.cpp index 3aa6623..89043c1 100755 --- a/plugin/mms_plugin/MmsPluginMain.cpp +++ b/plugin/mms_plugin/MmsPluginMain.cpp @@ -14,27 +14,18 @@ * limitations under the License. */ -#include -#include #include -#include - +#include "MsgException.h" +#include "MsgGconfWrapper.h" +#include "MsgUtilFile.h" +#include "MmsPluginDebug.h" #include "MmsPluginTypes.h" #include "MmsPluginMain.h" #include "MmsPluginTransport.h" -#include "MsgDebug.h" -#include "MsgException.h" - -#include "MmsPluginMain.h" -#include "MmsPluginMessage.h" #include "MmsPluginStorage.h" #include "MmsPluginInternal.h" #include "MmsPluginEventHandler.h" -#include "MsgGconfWrapper.h" #include "MmsPluginCodec.h" -#include "MsgUtilFile.h" -#include "MmsPluginUserAgent.h" - /*================================================================================================== FUNCTION IMPLEMENTATION diff --git a/plugin/mms_plugin/MmsPluginMessage.cpp b/plugin/mms_plugin/MmsPluginMessage.cpp index 22ef657..ef507cf 100755 --- a/plugin/mms_plugin/MmsPluginMessage.cpp +++ b/plugin/mms_plugin/MmsPluginMessage.cpp @@ -18,143 +18,21 @@ #include #include #include -#include -#include "MsgTypes.h" #include "MsgCppTypes.h" -#include "MsgException.h" #include "MsgStorageTypes.h" #include "MsgSettingTypes.h" +#include "MsgUtilFile.h" +#include "MsgGconfWrapper.h" +#include "MsgMmsMessage.h" +#include "MmsPluginTypes.h" +#include "MmsPluginDebug.h" #include "MmsPluginMessage.h" #include "MmsPluginMIME.h" #include "MmsPluginAvCodec.h" -#include "MsgUtilFile.h" -#include "MsgDebug.h" -#include "MmsPluginCodec.h" #include "MmsPluginStorage.h" -#include "MsgMmsMessage.h" -#include "MsgGconfWrapper.h" -#include "MmsPluginUtil.h" #include "MmsPluginSMILValidate.h" - - -bool MmsInitMsgAttrib(MmsAttrib *pAttrib) -{ - MSG_DEBUG("MmsInitMsgAttrib"); - - pAttrib->bAskDeliveryReport = false; - - pAttrib->bAskReadReply = false; - pAttrib->bRead = false; - pAttrib->bReportAllowed = false; - pAttrib->readReportAllowedType = MMS_RECEIVE_READ_REPORT_ALLOWED; - pAttrib->readReportSendStatus = MMS_RECEIVE_READ_REPORT_NO_SEND; - pAttrib->bReadReportSent = false; - - pAttrib->bHideAddress = false; - pAttrib->date = 0; - pAttrib->bUseDeliveryCustomTime = false; - pAttrib->deliveryTime.type = MMS_TIMETYPE_RELATIVE; - pAttrib->deliveryTime.time = 0; - pAttrib->bUseExpiryCustomTime = false; - pAttrib->expiryTime.type = MMS_TIMETYPE_RELATIVE; - pAttrib->expiryTime.time = 0; - memset(&pAttrib->expiryTime, 0, sizeof(MmsTimeStruct)); - pAttrib->msgClass = MMS_MSGCLASS_PERSONAL; - pAttrib->msgStatus = MSG_DELIVERY_REPORT_NONE; - pAttrib->priority = MMS_PRIORITY_NORMAL; - pAttrib->responseStatus = MMS_RESPSTATUS_ERROR; - pAttrib->retrieveStatus = MMS_RETRSTATUS_ERROR; - pAttrib->contentType = MIME_UNKNOWN; - pAttrib->msgSize = 0; - pAttrib->bLeaveCopy = true; - - pAttrib->specialMsgType = MMS_SPECIAL_MSG_TYPE_NONE; -#ifdef __SUPPORT_DRM__ - pAttrib->drmType = MSG_DRM_TYPE_NONE; - pAttrib->roWaitingTimerMax = 0; - pAttrib->pszDrmData = NULL; -#endif - pAttrib->version = MMS_VERSION; - - memset(pAttrib->szFrom, 0, MSG_LOCALE_ADDR_LEN + 10); - memset(pAttrib->szResponseText, 0, MMS_LOCALE_RESP_TEXT_LEN + 1); - memset(pAttrib->szRetrieveText, 0, MMS_LOCALE_RESP_TEXT_LEN + 1); - memset(pAttrib->szSubject, 0, MSG_LOCALE_SUBJ_LEN + 1); - pAttrib->szTo = NULL; - pAttrib->szCc = NULL; - pAttrib->szBcc = NULL; - - pAttrib->pMultiStatus = NULL; - - pAttrib->replyCharge.chargeType = MMS_REPLY_NONE; - memset(&pAttrib->replyCharge.deadLine , 0, sizeof(MmsTimeStruct)); - pAttrib->replyCharge.chargeSize = 0; - memset(pAttrib->replyCharge.szChargeID, 0, MMS_MSG_ID_LEN); - - return true; -} - -bool MmsInitMsgType(MsgType *pMsgType) -{ - MSG_DEBUG("MmsInitMsgType"); - pMsgType->offset = 0; - pMsgType->size = 0; - pMsgType->contentSize = 0; - pMsgType->disposition = -1; - pMsgType->encoding = -1; - pMsgType->type = MIME_UNKNOWN; - pMsgType->section = -1; - - pMsgType->szOrgFilePath[0] = '\0'; - pMsgType->szContentID[0] = '\0'; - pMsgType->szContentLocation[0] = '\0'; - - pMsgType->szContentRepPos[0] = '\0'; - pMsgType->szContentRepSize[0] = '\0'; - pMsgType->szContentRepIndex[0] = '\0'; - - MmsInitMsgContentParam(&pMsgType->param); -#ifdef __SUPPORT_DRM__ - __MsgInitMsgDRMInfo(&pMsgType->drmInfo); -#endif - - return true; -} - -bool MmsInitMsgBody(MsgBody *pMsgBody) -{ - MSG_DEBUG("MmsInitMsgBody"); - pMsgBody->offset = 0; - pMsgBody->size = 0; - pMsgBody->body.pText = NULL; - - MmsInitMsgType(&pMsgBody->presentationType); - pMsgBody->pPresentationBody = NULL; - - memset(pMsgBody->szOrgFilePath, 0, MSG_FILEPATH_LEN_MAX); - - return true; -} - -bool MmsInitMsgContentParam(MsgContentParam *pMsgContentParam) -{ - MSG_DEBUG("MmsInitMsgContentParam"); - pMsgContentParam->charset = MSG_CHARSET_UNKNOWN; - pMsgContentParam->type = MIME_UNKNOWN; - pMsgContentParam->szBoundary[0] = '\0'; - pMsgContentParam->szFileName[0] = '\0'; - pMsgContentParam->szName[0] = '\0'; - pMsgContentParam->szStart[0] = '\0'; - pMsgContentParam->szStartInfo[0] = '\0'; - pMsgContentParam->pPresentation = NULL; - pMsgContentParam->reportType = MSG_PARAM_REPORT_TYPE_UNKNOWN; // only used as parameter of Content-Type: multipart/report; report-type -#ifdef FEATURE_JAVA_MMS - pMsgContentParam->szApplicationID = NULL; - pMsgContentParam->szReplyToApplicationID = NULL; -#endif - return true; -} +#include "MmsPluginUtil.h" bool MmsSetMsgAddressList(MmsAttrib *pAttrib, const MSG_MESSAGE_INFO_S * pMsgInfo) { @@ -940,197 +818,6 @@ void MmsComposeNotiMessage(MmsMsg *pMmsMsg, msg_message_id_t msgID) MSG_END(); } -bool MmsGetMmsMessageBody(MmsMsg *pMmsMsg, char *retrievedFilePath) -{ - FILE *pFile = NULL; - MsgMultipart *pMultipart = NULL; - int attachmax = MSG_ATTACH_MAX; - int nSize = 0; - - /* read from MMS raw file */ - if (retrievedFilePath) - strncpy(pMmsMsg->szFileName, retrievedFilePath + strlen(MSG_DATA_PATH), strlen(retrievedFilePath + strlen(MSG_DATA_PATH))); - else - goto __CATCH; - - pFile = MsgOpenFile(retrievedFilePath, "rb"); - - if (pFile == NULL) { - MSG_DEBUG( "_MmsReadMsgBody: invalid mailbox\n"); - goto __CATCH; - } - - if (MsgGetFileSize(retrievedFilePath, &nSize) == false) { - MSG_DEBUG("MsgGetFileSize: failed"); - goto __CATCH; - } - - MmsRegisterDecodeBuffer(); - - if (MmsBinaryDecodeMsgHeader(pFile, nSize) == false) { - MSG_DEBUG( "_MmsReadMsgBody: MmsBinaryDecodeMsgHeader fail...\n"); - goto __CATCH; - } - - if (MmsBinaryDecodeMsgBody(pFile, retrievedFilePath, nSize) == false) { - MSG_DEBUG( "_MmsReadMsgBody: MmsBinaryDecodeMsgBody fail\n"); - goto __CATCH; - } - - /* Set mmsHeader.msgType & msgBody to pMsg ----------- */ - - pMmsMsg->mmsAttrib.contentType = (MimeType)mmsHeader.msgType.type; - - memcpy(&(pMmsMsg->msgType), &(mmsHeader.msgType), sizeof(MsgType)); - memcpy(&(pMmsMsg->msgBody), &(mmsHeader.msgBody), sizeof(MsgBody)); - - MSG_DEBUG("#############################"); - MSG_DEBUG("## pMmsMsg->msgType.type = %d ##", pMmsMsg->msgType.type); - MSG_DEBUG("## pMmsMsg->msgType.szContentID = %s ##", pMmsMsg->msgType.szContentID); - MSG_DEBUG("## pMmsMsg->msgType.szContentLocation = %s ##", pMmsMsg->msgType.szContentLocation); - MSG_DEBUG("#############################"); - - if (pMmsMsg->msgBody.pPresentationBody) { - if(MsgFseek(pFile, pMmsMsg->msgBody.pPresentationBody->offset, SEEK_SET) < 0) - goto __CATCH; - - pMmsMsg->msgBody.pPresentationBody->body.pText = (char *)malloc(pMmsMsg->msgBody.pPresentationBody->size + 1); - if (pMmsMsg->msgBody.pPresentationBody->body.pText == NULL) - goto __CATCH; - - memset(pMmsMsg->msgBody.pPresentationBody->body.pText, 0, pMmsMsg->msgBody.pPresentationBody->size + 1); - ULONG nRead = 0; - nRead = MsgReadFile(pMmsMsg->msgBody.pPresentationBody->body.pText, sizeof(char), pMmsMsg->msgBody.pPresentationBody->size, pFile); - - if (nRead == 0) - goto __CATCH; - } - - MsgCloseFile(pFile); - pFile = NULL; - - /* nPartCount */ - pMmsMsg->nPartCount = 0; - - if (MsgIsMultipart(mmsHeader.msgType.type) == true) { - pMultipart = pMmsMsg->msgBody.body.pMultipart; - while (pMultipart) { - pMmsMsg->nPartCount++; - - if (pMultipart->type.type == MIME_TEXT_PLAIN) - attachmax++; - - if ((mmsHeader.msgType.type == MIME_APPLICATION_VND_WAP_MULTIPART_MIXED) || - (mmsHeader.msgType.type == MIME_MULTIPART_MIXED)) { - if ((pMmsMsg->nPartCount >= attachmax ) && (pMultipart->pNext != NULL)) { - MsgFreeBody(pMultipart->pNext->pBody, pMultipart->pNext->type.type); - - free(pMultipart->pNext->pBody); - pMultipart->pNext->pBody = NULL; - - free(pMultipart->pNext); - - pMultipart->pNext = NULL; - break; - } - } - pMultipart = pMultipart->pNext; - } - } else { - if (pMmsMsg->msgBody.size > 0) - pMmsMsg->nPartCount++; - } - - //call before processing urgent event. - MmsInitHeader(); - MmsUnregisterDecodeBuffer(); - - return true; - -__CATCH: - - MmsInitHeader(); - MmsUnregisterDecodeBuffer(); - - if (pFile != NULL) { - MsgCloseFile(pFile); - pFile = NULL; - } - - MsgFreeBody(&pMmsMsg->msgBody, pMmsMsg->msgType.type); - MSG_DEBUG("_MmsReadMsgBody: E N D ( fail ) ******************** \n"); - - return false; -} - -#ifdef MMS_DELIEVERY_IND_ENABLED -MmsMsgMultiStatus *MmsComposeDeliveryIndMessage(MmsMsg *pMmsMsg, msg_message_id_t msgId) -{ - MmsMsgMultiStatus *pStatus = NULL; - MmsMsgMultiStatus *pLastStatus = NULL; - bool bFound = false; - - MmsInitMsgAttrib(&pMmsMsg->mmsAttrib); - MmsInitMsgType(&pMmsMsg->msgType); - MmsInitMsgBody(&pMmsMsg->msgBody); - - pMmsMsg->mmsAttrib.version = mmsHeader.version; - - pMmsMsg->mmsAttrib.pMultiStatus = MmsGetMultiStatus(msgId); - - pStatus = pMmsMsg->mmsAttrib.pMultiStatus; - - MSG_DEBUG("### pStatus->szTo = %s ###", pStatus->szTo); - - while (pStatus && !bFound) { - MSG_DEBUG("### MmsAddrUtilCompareAddr ###"); - MSG_DEBUG("### mmsHeader.pTo->szAddr = %s ###", mmsHeader.pTo->szAddr); - if (MmsAddrUtilCompareAddr(pStatus->szTo, mmsHeader.pTo->szAddr)) { - bFound = true; - break; - } - - pStatus = pStatus->pNext; - } - - if (bFound == false) { - MSG_DEBUG("### bFound == false ###"); - /* Queue the delivery report --------------------------- */ - - pStatus = (MmsMsgMultiStatus *)malloc(sizeof(MmsMsgMultiStatus)); - memset(pStatus, 0, sizeof(MmsMsgMultiStatus)); - - pStatus->readStatus = MMS_READSTATUS_NONE; - - memset(pStatus->szTo, 0, MSG_ADDR_LEN + 1); - strncpy(pStatus->szTo, mmsHeader.pTo->szAddr, MSG_ADDR_LEN); - - if (pMmsMsg->mmsAttrib.pMultiStatus == NULL) { - /* first delivery report */ - pMmsMsg->mmsAttrib.pMultiStatus = pStatus; - } else { - pLastStatus = pMmsMsg->mmsAttrib.pMultiStatus; - while (pLastStatus->pNext) { - pLastStatus = pLastStatus->pNext; - } - - pLastStatus->pNext = pStatus; - pLastStatus = pStatus; - } - } - - pStatus->handledTime = mmsHeader.date; - pStatus->msgStatus = mmsHeader.msgStatus; - pStatus->bDeliveryReportIsRead = false; - - _MmsDataUpdateLastStatus(pMmsMsg); - - pStatus->bDeliveyrReportIsLast = true; - - return pStatus; -} -#endif - void MmsComposeReadReportMessage(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, msg_message_id_t selectedMsgId) { struct tm *timeInfo = NULL; @@ -1186,19 +873,6 @@ int MmsSearchMsgId(char *toNumber, char *szMsgID) return msgId; } -MmsMsgMultiStatus *MmsGetMultiStatus(msg_message_id_t msgId) -{ - MmsMsgMultiStatus *pMultiStatus; - - pMultiStatus = MmsPluginStorage::instance()->getMultiStatus(msgId); - - MSG_DEBUG("### szTo = %s ###", pMultiStatus->szTo); - - MSG_END(); - - return pMultiStatus; -} - bool MmsCheckAdditionalMedia(MMS_MESSAGE_DATA_S *pMsgData, MsgType *partHeader) { if (_MsgMmsFindMatchedMedia(pMsgData, partHeader->param.szFileName)) @@ -1256,29 +930,6 @@ bool MmsRemovePims(MMS_MESSAGE_DATA_S *pMsgData) return true; } - -#ifdef __SUPPORT_DRM__ -bool __MsgInitMsgDRMInfo(MsgDRMInfo *pMsgDrmInfo) -{ - pMsgDrmInfo->contentType = MIME_UNKNOWN; - pMsgDrmInfo->drmType = MSG_DRM_TYPE_NONE; - - pMsgDrmInfo->szContentName = NULL; - pMsgDrmInfo->szContentURI = NULL; - pMsgDrmInfo->szContentDescription = NULL; - pMsgDrmInfo->szContentVendor = NULL; - pMsgDrmInfo->szRightIssuer = NULL; - pMsgDrmInfo->szDrm2FullPath = NULL; - pMsgDrmInfo->roWaitingTimerMax = 0; - pMsgDrmInfo->bFwdLock = false; - pMsgDrmInfo->bNoScreen = false; - pMsgDrmInfo->bNoRingTone = false; - pMsgDrmInfo->pszContentType = NULL; - - return true; -} -#endif - msg_error_t MmsMakePreviewInfo(int msgId, MMS_MESSAGE_DATA_S *pMmsMsg) { MMS_PAGE_S *pPage = NULL; diff --git a/plugin/mms_plugin/MmsPluginSMILValidate.cpp b/plugin/mms_plugin/MmsPluginSMILValidate.cpp index 38df2aa..b03f9a6 100755 --- a/plugin/mms_plugin/MmsPluginSMILValidate.cpp +++ b/plugin/mms_plugin/MmsPluginSMILValidate.cpp @@ -14,11 +14,11 @@ * limitations under the License. */ +#include "MsgMmsMessage.h" +#include "MmsPluginDebug.h" #include "MmsPluginSMILValidate.h" -#include "MsgDebug.h" -#include "MsgUtilFile.h" #include "MmsPluginSmil.h" -#include "MsgMmsMessage.h" + #define MSG_RETURN_VAL_IF_FAIL(Expr, Val) \ if (!(Expr)) { \ diff --git a/plugin/mms_plugin/MmsPluginSmil.cpp b/plugin/mms_plugin/MmsPluginSmil.cpp index 694cbb4..a1a9e37 100755 --- a/plugin/mms_plugin/MmsPluginSmil.cpp +++ b/plugin/mms_plugin/MmsPluginSmil.cpp @@ -14,19 +14,19 @@ * limitations under the License. */ -#include +#include #include #include #include + +#include "MsgMmsMessage.h" +#include "MsgUtilFile.h" +#include "MmsPluginTypes.h" #include "MmsPluginSmil.h" -#include "MmsPluginMessage.h" +#include "MmsPluginMIME.h" #include "MmsPluginStorage.h" -#include "MsgDebug.h" +#include "MmsPluginDebug.h" #include "MmsPluginCodec.h" -#include "MsgMmsMessage.h" - -#include "MsgTypes.h" -#include "MsgUtilFile.h" #define MSG_STDSTR_SHORT 0x7F diff --git a/plugin/mms_plugin/MmsPluginStorage.cpp b/plugin/mms_plugin/MmsPluginStorage.cpp index 80ad7e6..7c56c97 100755 --- a/plugin/mms_plugin/MmsPluginStorage.cpp +++ b/plugin/mms_plugin/MmsPluginStorage.cpp @@ -18,17 +18,15 @@ #include #include -#include "MsgDebug.h" #include "MsgException.h" #include "MsgUtilFile.h" #include "MsgMmsMessage.h" -#include "MsgNotificationWrapper.h" -#include "MsgUtilStorage.h" +#include "MsgStorageTypes.h" +#include "MmsPluginDebug.h" #include "MmsPluginStorage.h" -#include "MmsPluginCodec.h" +#include "MmsPluginMessage.h" #include "MmsPluginSmil.h" #include "MmsPluginDrm.h" -#include "MsgHelper.h" static void __MmsReleaseMmsLists(MMS_MESSAGE_DATA_S *mms_data) { @@ -39,6 +37,7 @@ static void __MmsReleaseMmsLists(MMS_MESSAGE_DATA_S *mms_data) _MsgMmsReleaseMetaList(mms_data); } + /*================================================================================================== IMPLEMENTATION OF SmsPluginStorage - Member Functions ==================================================================================================*/ @@ -869,51 +868,6 @@ msg_error_t MmsPluginStorage::updateMmsAttachCount(msg_message_id_t msgId, int c return MSG_SUCCESS; } -MmsMsgMultiStatus *MmsPluginStorage::getMultiStatus(msg_message_id_t msgId) -{ - MSG_BEGIN(); - - MmsMsgMultiStatus *pMultiStatus = NULL; - - char sqlQuery[MAX_QUERY_LEN + 1]; - - memset(sqlQuery, 0x00, sizeof(sqlQuery)); - - snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.ADDRESS_VAL, A.DELIVERY_REPORT_STATUS, A.DELIVERY_REPORT_TIME, A.READ_REPORT_STATUS, A.READ_REPORT_TIME \ - FROM %s A, %s B WHERE A.MSG_ID = %d AND A.CONV_ID = B.CONV_ID;", - MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, msgId); - - if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) - MSG_DEBUG("MSG_ERR_DB_PREPARE"); - - if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) { - pMultiStatus = (MmsMsgMultiStatus *)malloc(sizeof(MmsMsgMultiStatus)); - - memset(pMultiStatus, 0, sizeof(MmsMsgMultiStatus)); - - if (dbHandle.columnText(0) != NULL) { - strncpy(pMultiStatus->szTo, (char *)dbHandle.columnText(0), (strlen((char *)dbHandle.columnText(0)) > MAX_ADDRESS_VAL_LEN ? MAX_ADDRESS_VAL_LEN : strlen((char *)dbHandle.columnText(0)))); - MSG_DEBUG("### szTo = %s ###", pMultiStatus->szTo); - } - - pMultiStatus->msgStatus = (msg_delivery_report_status_t)dbHandle.columnInt(1); - pMultiStatus->handledTime = dbHandle.columnInt(2); - pMultiStatus->readStatus = (msg_read_report_status_t)dbHandle.columnInt(3); - pMultiStatus->readTime = dbHandle.columnInt(4); - } else { - MSG_DEBUG("MSG_ERR_DB_STEP"); - } - - /* possible NULL pointer dereference*/ - if (pMultiStatus != NULL) - pMultiStatus->pNext = NULL; - - dbHandle.finalizeQuery(); - - return pMultiStatus; -} - - void MmsPluginStorage::getMmsAttrib(msg_message_id_t msgId, MmsMsg *pMmsMsg) { char sqlQuery[MAX_QUERY_LEN + 1]; @@ -1084,6 +1038,36 @@ msg_error_t MmsPluginStorage::getTrID(MSG_MESSAGE_INFO_S *pMsgInfo,char *pszTrID } /* reject_msg_support */ +msg_error_t MmsPluginStorage::getAddressInfo(msg_message_id_t msgId, MSG_ADDRESS_INFO_S *pAddrInfo) +{ + char sqlQuery[MAX_QUERY_LEN+1]; + + // Add Address + memset(sqlQuery, 0x00, sizeof(sqlQuery)); + + snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_TYPE, A.RECIPIENT_TYPE, A.CONTACT_ID, A.ADDRESS_VAL \ + FROM %s A, %s B WHERE A.CONV_ID = B.CONV_ID AND B.MSG_ID = %d;", + MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, msgId); + + if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS) + return MSG_ERR_DB_PREPARE; + + if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) { + pAddrInfo->addressType = dbHandle.columnInt(0); + pAddrInfo->recipientType = dbHandle.columnInt(1); + pAddrInfo->contactId = dbHandle.columnInt(2); + + strncpy(pAddrInfo->addressVal, (char*)dbHandle.columnText(3), MAX_ADDRESS_VAL_LEN); + } else { + dbHandle.finalizeQuery(); + return MSG_ERR_DB_STEP; + } + + dbHandle.finalizeQuery(); + + return MSG_SUCCESS; +} + msg_error_t MmsPluginStorage::getMmsRawFilePath(msg_message_id_t msgId, char *pFilepath) { diff --git a/plugin/mms_plugin/MmsPluginTextConvert.cpp b/plugin/mms_plugin/MmsPluginTextConvert.cpp index f445741..169456f 100755 --- a/plugin/mms_plugin/MmsPluginTextConvert.cpp +++ b/plugin/mms_plugin/MmsPluginTextConvert.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ #include +#include "MmsPluginDebug.h" #include "MmsPluginMIME.h" #include "MmsPluginCodec.h" #include "MmsPluginTextConvert.h" -#include "MsgDebug.h" #include "MmsPluginUtil.h" const char *MmsPluginTextConvertGetCharSet(int MIBEnum) diff --git a/plugin/mms_plugin/MmsPluginTransport.cpp b/plugin/mms_plugin/MmsPluginTransport.cpp index 96b1d5b..e090a84 100755 --- a/plugin/mms_plugin/MmsPluginTransport.cpp +++ b/plugin/mms_plugin/MmsPluginTransport.cpp @@ -15,13 +15,12 @@ */ #include -#include "MmsPluginEventHandler.h" -#include "MmsPluginTransport.h" #include "MsgUtilFile.h" -#include "MmsPluginCodec.h" -#include "MmsPluginMessage.h" +#include "MmsPluginDebug.h" +#include "MmsPluginTypes.h" +#include "MmsPluginTransport.h" #include "MmsPluginUserAgent.h" - +#include "MsgGconfWrapper.h" /*================================================================================================== IMPLEMENTATION OF MmsPluginTransport - Member Functions @@ -57,6 +56,9 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo) reqItem.isCompleted = false; reqItem.reqID = pReqInfo->reqId; + char *msisdn = NULL; + msisdn = MsgSettingGetString(MSG_SIM_MSISDN); + MSG_DEBUG("pReqInfo->msgInfo.msgType.subType [%d]", pReqInfo->msgInfo.msgType.subType); switch (pReqInfo->msgInfo.msgType.subType) { @@ -67,6 +69,7 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo) reqItem.eMmsPduType = eMMS_SEND_REQ; reqItem.eHttpCmdType = eHTTP_CMD_POST_TRANSACTION; reqItem.pPostData = MsgOpenAndReadMmsFile(pReqInfo->msgInfo.msgData, 0, -1, &reqItem.postDataLen); + MSG_MMS_VLD_INFO("%d, MMS Send Start %s->%s, Success", pReqInfo->msgInfo.msgId, (msisdn == NULL)?"ME":msisdn, pReqInfo->msgInfo.addressList[0].addressVal); break; case MSG_GET_MMS: @@ -77,9 +80,10 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo) reqItem.getDataLen = pReqInfo->msgInfo.dataSize; reqItem.pGetData = (char *)malloc(reqItem.getDataLen); memcpy(reqItem.pGetData, pReqInfo->msgInfo.msgData, reqItem.getDataLen); + MSG_MMS_VLD_INFO("%d, MMS Receive Auto Start %s->%s, Success", pReqInfo->msgInfo.msgId, pReqInfo->msgInfo.addressList[0].addressVal, (msisdn == NULL)?"ME":msisdn); break; - case MSG_NOTIFYRESPIND_MMS: + case MSG_NOTIFYRESPIND_MMS: //reject { MSG_DEBUG("######### MANUAL RETRIEVE : SEND NOTIFY RESPONSE IND"); reqItem.msgId = pReqInfo->msgInfo.msgId; @@ -100,6 +104,7 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo) reqItem.getDataLen = pReqInfo->msgInfo.dataSize; reqItem.pGetData = (char *)malloc(reqItem.getDataLen); memcpy(reqItem.pGetData, pReqInfo->msgInfo.msgData, reqItem.getDataLen); + MSG_MMS_VLD_INFO("%d, MMS Receive Manual Start %s->%s, Success", pReqInfo->msgInfo.msgId, pReqInfo->msgInfo.addressList[0].addressVal, (msisdn == NULL)?"ME":msisdn); break; case MSG_READREPLY_MMS: @@ -136,6 +141,7 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo) reqItem.eMmsPduType = eMMS_SEND_REQ; reqItem.eHttpCmdType = eHTTP_CMD_POST_TRANSACTION; reqItem.pPostData = MsgOpenAndReadMmsFile(pReqInfo->msgInfo.msgData, 0, -1, &reqItem.postDataLen); + MSG_MMS_VLD_INFO("%d, MMS Send Start %s->%s, Success", pReqInfo->msgInfo.msgId, (msisdn == NULL)?"ME":msisdn, pReqInfo->msgInfo.addressList[0].addressVal); break; } @@ -143,7 +149,6 @@ void MmsPluginTransport::submitRequest(const MSG_REQUEST_INFO_S *pReqInfo) MmsPluginUaManager::instance()->start(); } - void MmsPluginTransport::cancelRequest(msg_request_id_t reqId) { diff --git a/plugin/mms_plugin/MmsPluginUserAgent.cpp b/plugin/mms_plugin/MmsPluginUserAgent.cpp index eb334e3..d3889c4 100755 --- a/plugin/mms_plugin/MmsPluginUserAgent.cpp +++ b/plugin/mms_plugin/MmsPluginUserAgent.cpp @@ -14,19 +14,21 @@ * limitations under the License. */ -#include -#include +#include "MsgException.h" +#include "MsgUtilFile.h" +#include "MsgGconfWrapper.h" + + +#include "MmsPluginDebug.h" #include "MmsPluginUserAgent.h" +#include "MmsPluginHttp.h" +#include "MmsPluginConnManWrapper.h" #include "MmsPluginEventHandler.h" -#include "MsgGconfWrapper.h" #include "MmsPluginInternal.h" -#include "MsgUtilFile.h" #include "MmsPluginCodec.h" -#include "MsgException.h" #include "MmsPluginDrm.h" #include "MmsPluginStorage.h" - extern MmsHeader mmsHeader; void PRINT_PDU_TYPE(MMS_PDU_TYPE_T pduType) diff --git a/plugin/mms_plugin/MmsPluginUtil.cpp b/plugin/mms_plugin/MmsPluginUtil.cpp index 819ccf4..f23605c 100755 --- a/plugin/mms_plugin/MmsPluginUtil.cpp +++ b/plugin/mms_plugin/MmsPluginUtil.cpp @@ -17,19 +17,22 @@ #include #include #include - #include - -//----str #include - -#include "MsgDebug.h" +#include "MsgUtilFile.h" +#include "MmsPluginDebug.h" #include "MmsPluginUtil.h" + bool makeImageThumbnail(char *srcPath, char *dstPath) { if (srcPath == NULL || dstPath == NULL) { - MSG_DEBUG("Make thumbnail: failed [Invalid Parameter]"); + MSG_DEBUG(MMS_DEBUG_STR_INVALID_PARAM" src = %p, dst = %p", srcPath, dstPath); + return false; + } + + if (MsgAccessFile(srcPath, R_OK) == false) { + MSG_DEBUG("not exist source file [%s]", srcPath); return false; } @@ -40,6 +43,11 @@ bool makeImageThumbnail(char *srcPath, char *dstPath) return false; } + if (MsgAccessFile(dstPath, F_OK) == false) { + MSG_DEBUG("not exist result file [%s]", dstPath); + return false; + } + MSG_DEBUG("Make thumbnail: success [%s]", dstPath); return true; } @@ -52,7 +60,12 @@ bool makeVideoThumbnail(char *srcPath, char *dstPath) int trackCount = 0; if (srcPath == NULL || dstPath == NULL) { - MSG_DEBUG("Make thumbnail: failed [Invalid Parameter]"); + MSG_DEBUG(MMS_DEBUG_STR_INVALID_PARAM" src = %p, dst = %p", srcPath, dstPath); + return false; + } + + if (MsgAccessFile(srcPath, R_OK) == false) { + MSG_DEBUG("not exist source file [%s]", srcPath); return false; } @@ -122,36 +135,52 @@ bool makeVideoThumbnail(char *srcPath, char *dstPath) return false; } + if (MsgAccessFile(dstPath, F_OK) == false) { + MSG_DEBUG("not exist result file [%s]", dstPath); + return false; + } + MSG_DEBUG("Make thumbnail: success [%s]", dstPath); mm_file_destroy_content_attrs(content_attrs); return true; } -//---------------------------------------------------------------------- bool MsgIsASCII(char *pszText) { + if (pszText == NULL) { + MSG_DEBUG(MMS_DEBUG_STR_INVALID_PARAM" pszText = %p", pszText); + return false; + } + int length = strlen(pszText); + if (length <= 0) { + MSG_DEBUG("Input parameter is NULL string"); + return false; + } for (int i = 0; i < length; ++i) { if (!isascii(pszText[i])) { - MSG_DEBUG("_MsgIsASCII false."); + MSG_DEBUG("It is not Ascii code"); return false; } } - MSG_DEBUG("_MsgIsASCII true."); + MSG_DEBUG("It is Ascii code"); return true; } - bool MsgReplaceNonAscii(char *szInText, char **szOutText, char replaceChar) { - MSG_DEBUG("_MsgReplaceNonAscii"); + int nCount = 0; int index = 0; int cLen = 0; char *pNew = NULL; + if (szInText == NULL || szOutText == NULL) { + MSG_DEBUG(MMS_DEBUG_STR_INVALID_PARAM" szInText = %p, szOutText = %p", szInText, szOutText); + return false; + } cLen = strlen(szInText); pNew = (char *)malloc(cLen + 1); @@ -163,12 +192,12 @@ bool MsgReplaceNonAscii(char *szInText, char **szOutText, char replaceChar) while (*(szInText+nCount) != '\0') { if (0x0001 <= *(szInText+nCount) && *(szInText+nCount) <= 0x007F) { - MSG_DEBUG("_MsgReplaceNonAscii: non ascii characters (1bytes). \n"); + MSG_DEBUG("non ascii characters (1bytes). \n"); pNew[index] = szInText[nCount]; nCount += 1; index += 1; } else { - MSG_DEBUG("_MsgReplaceNonAscii: UTF-8 characters (2bytes). \n"); + MSG_DEBUG("UTF-8 characters (2bytes). \n"); pNew[index] = replaceChar; nCount += 1; index +=1; @@ -181,40 +210,38 @@ bool MsgReplaceNonAscii(char *szInText, char **szOutText, char replaceChar) bool MsgIsSpace(char *pszText) { - MSG_DEBUG("_MsgIsSpace"); if (!pszText) { - MSG_DEBUG("_MsgIsSpace: pszText == NULL!\n"); + MSG_DEBUG(MMS_DEBUG_STR_INVALID_PARAM); return false; } - if (strchr(pszText, ' ') != NULL) - return true; - else + if (strchr(pszText, ' ') == NULL) { + MSG_DEBUG("space is Not exist"); return false; + } + + MSG_DEBUG("space exist"); + return true; } bool MsgReplaceSpecialChar(char *szInText, char **szOutText, char specialChar) { - MSG_DEBUG("_MsgReplaceSpecialChar"); char *pszOutText = NULL; char szBuf[10] = {0, }; char temp[5] = {0, }; int cLen = 0; int i = 0; - if (!szInText) { - MSG_DEBUG("_MsgReplaceSpecialChar: szInText == NULL! \n"); + if (!szInText || !szOutText) { + MSG_DEBUG(MMS_DEBUG_STR_INVALID_PARAM" szInText = %p, szOutText = %p", szInText, szOutText); return false; } - if (!szOutText) - return false; - cLen = strlen(szInText); if (specialChar == ' ') { if ((pszOutText = (char *)malloc(cLen + 1)) == NULL) { - MSG_DEBUG("_MsgReplaceSpecialChar : %d line. MemAlloc failed.\n", __LINE__); + MSG_DEBUG("%d line. MemAlloc failed.\n", __LINE__); return false; } memset(pszOutText, 0, cLen + 1); @@ -243,14 +270,13 @@ bool MsgReplaceSpecialChar(char *szInText, char **szOutText, char specialChar) } } - MSG_DEBUG("_MsgReplaceSpecialChar : output text : [%s]\n", pszOutText); + MSG_DEBUG("output text : [%s]\n", pszOutText); return true; } char *MsgStrAppend(char *szInputStr1, char *szInputStr2) { - MSG_DEBUG("MsgStrAppend"); char *szOutputStr = NULL; if (szInputStr1 == NULL) { @@ -290,7 +316,7 @@ char *MsgStrCopy(const char *string) if (string) { pDst = (char *)malloc(1 + strlen(string)); if (pDst == NULL) { - MSG_DEBUG("MsgStrCopy: pDst MemAlloc Fail \n"); + MSG_DEBUG("pDst MemAlloc Fail \n"); return NULL; } diff --git a/plugin/mms_plugin/include/MmsPluginAvCodec.h b/plugin/mms_plugin/include/MmsPluginAvCodec.h index 84ac70e..3d99f0e 100755 --- a/plugin/mms_plugin/include/MmsPluginAvCodec.h +++ b/plugin/mms_plugin/include/MmsPluginAvCodec.h @@ -14,7 +14,10 @@ * limitations under the License. */ -#include "MsgTypes.h" +#ifndef MMS_PLUGIN_AVCODEC_H +#define MMS_PLUGIN_AVCODEC_H + +#include "MmsPluginTypes.h" #define FILEEXT_MAX 5 @@ -89,4 +92,7 @@ typedef enum { } AvCodecType; + AvCodecType AvGetFileCodecType(const char *szFileName); + +#endif //MMS_PLUGIN_AVCODEC_H diff --git a/plugin/mms_plugin/include/MmsPluginCodec.h b/plugin/mms_plugin/include/MmsPluginCodec.h index 743fb9d..625bd11 100755 --- a/plugin/mms_plugin/include/MmsPluginCodec.h +++ b/plugin/mms_plugin/include/MmsPluginCodec.h @@ -16,12 +16,10 @@ #ifndef MMS_PLUGIN_CODEC_H #define MMS_PLUGIN_CODEC_H -/*================================================================================================== - HEADER -==================================================================================================*/ + #include "MmsPluginCodecTypes.h" #include "MmsPluginCodecCommon.h" #include "MmsPluginEncode.h" #include "MmsPluginDecode.h" -#endif +#endif //MMS_PLUGIN_CODEC_H diff --git a/plugin/mms_plugin/include/MmsPluginCodecCommon.h b/plugin/mms_plugin/include/MmsPluginCodecCommon.h index 9aaa0a8..75037eb 100755 --- a/plugin/mms_plugin/include/MmsPluginCodecCommon.h +++ b/plugin/mms_plugin/include/MmsPluginCodecCommon.h @@ -32,5 +32,25 @@ unsigned char *MsgDecodeQuotePrintable(unsigned char *pSrc, unsigned long srcLen char *MsgDecodeText(char *pOri); +const char *MmsDebugGetMimeType(MimeType mimeType); +const char *MmsDebugGetMmsReport(MmsReport report); +const char *MmsDebugGetMmsReportAllowed(MmsReportAllowed reportAllowed); +const char *MmsDebugGetMmsReadStatus(msg_read_report_status_t readStatus); +const char *MmsDebugGetMsgType(MmsMsgType msgType); +const char *MmsDebugGetResponseStatus(MmsResponseStatus responseStatus); +const char *MmsDebugGetRetrieveStatus(MmsRetrieveStatus retrieveStatus); +const char *MmsDebugGetMsgStatus(msg_delivery_report_status_t msgStatus); +const char *MmsDebugGetMsgClass(MmsMsgClass msgClass); +const char *MmsDebugGetDataType(MmsDataType dataType); -#endif +bool MmsInitMsgType(MsgType *pMsgType); +bool MmsInitMsgBody(MsgBody *pMsgBody); +bool MmsInitMsgContentParam(MsgContentParam *pMsgContentParam); +bool MmsInitMsgAttrib(MmsAttrib *pAttrib); + +#ifdef __SUPPORT_DRM__ +bool MmsInitMsgDRMInfo(MsgDRMInfo *pMsgDrmInfo); +#endif//__SUPPORT_DRM__ + + +#endif //MMS_PLUGIN_CODEC_COMMON_H diff --git a/plugin/mms_plugin/include/MmsPluginCodecTypes.h b/plugin/mms_plugin/include/MmsPluginCodecTypes.h index aa0267b..829ca15 100755 --- a/plugin/mms_plugin/include/MmsPluginCodecTypes.h +++ b/plugin/mms_plugin/include/MmsPluginCodecTypes.h @@ -17,8 +17,7 @@ #ifndef MMS_PLUGIN_CODEC_TYPE_H #define MMS_PLUGIN_CODEC_TYPE_H -#include "msg_types.h" -#include "MsgTypes.h" +#include "MmsPluginTypes.h" #define MMS_MAJOR_VERSION 1 @@ -54,7 +53,18 @@ #define MSG_LOCALE_ADDR_LEN (3 * MAX_ADDRESS_VAL_LEN) #define MSG_BOUNDARY_LEN 70 #define MSG_LOCALE_NAME_LEN 150 -#define MSG_LOCALE_FILENAME_LEN_MAX (3 * 255) +#define MSG_LOCALE_FILENAME_LEN_MAX (3 * MSG_FILENAME_LEN_MAX) +#define MMS_READ_REPORT_STRING_READ "Read:" +#define MMS_READ_REPORT_STRING_DELETED "Deleted:" + +#define MSG_ATTACH_MAX 20 +#define MSG_STR_ADDR_DELIMETER ";" + +#define MMS_TEXT_LEN 2000 +#define MSG_CH_ADDR_DELIMETER ';' +#define MSG_MMS_STR_ADDR_DELIMETER MSG_STR_ADDR_DELIMETER +#define MSG_MMS_CH_ADDR_DELIMETER MSG_CH_ADDR_DELIMETER + typedef unsigned int UINT; typedef unsigned long int UINT32; @@ -551,4 +561,4 @@ typedef struct _MMS_MESSAGE_S { MsgBody msgBody; } MmsMsg; -#endif +#endif //MMS_PLUGIN_CODEC_TYPE_H diff --git a/plugin/mms_plugin/include/MmsPluginConnManWrapper.h b/plugin/mms_plugin/include/MmsPluginConnManWrapper.h index f2bf4c8..7944c2d 100755 --- a/plugin/mms_plugin/include/MmsPluginConnManWrapper.h +++ b/plugin/mms_plugin/include/MmsPluginConnManWrapper.h @@ -14,18 +14,13 @@ * limitations under the License. */ -#ifndef MMSPLUGINCONNMANWRAPPER_H -#define MMSPLUGINCONNMANWRAPPER_H +#ifndef MMS_PLUGIN_CONNMAN_H +#define MMS_PLUGIN_CONNMAN_H #include #include - -#include "MsgDebug.h" - -#include "MmsPluginTypes.h" #include "MsgMutex.h" - class MmsPluginCmAgent { public: @@ -69,5 +64,4 @@ private: net_profile_info_t mmsProfile; }; -#endif - +#endif //MMS_PLUGIN_CONNMAN_H diff --git a/plugin/mms_plugin/include/MmsPluginDebug.h b/plugin/mms_plugin/include/MmsPluginDebug.h index e3078b0..824be48 100755 --- a/plugin/mms_plugin/include/MmsPluginDebug.h +++ b/plugin/mms_plugin/include/MmsPluginDebug.h @@ -15,18 +15,14 @@ */ #ifndef MMS_PLUGIN_DEBUG_H -#define MMS_PLUGIN_DEBUG_H +#define MMS_PLUGIN_DEBUG_H -const char *MmsDebugGetMimeType(MimeType mimeType); -const char *MmsDebugGetMmsReport(MmsReport report); -const char *MmsDebugGetMmsReportAllowed(MmsReportAllowed reportAllowed); -const char *MmsDebugGetMmsReadStatus(msg_read_report_status_t readStatus); -const char *MmsDebugGetMsgType(MmsMsgType msgType); -const char *MmsDebugGetResponseStatus(MmsResponseStatus responseStatus); -const char *MmsDebugGetRetrieveStatus(MmsRetrieveStatus retrieveStatus); -const char *MmsDebugGetMsgStatus(msg_delivery_report_status_t msgStatus); -const char *MmsDebugGetMsgClass(MmsMsgClass msgClass); -const char *MmsDebugGetDataType(MmsDataType dataType); +#include "MsgDebug.h" + +#define MMS_DEBUG_STR_FAILED "Failed" +#define MMS_DEBUG_STR_SUCCESS "Success" +#define MMS_DEBUG_STR_INVALID_PARAM "Invalid Parameter" +#define MMS_DEBUG_STR_FILE_NOT_EXIST "File not exist" -#endif //MMS_PLUGIN_DEBUG_H +#endif //MMS_PLUGIN_DEBUG_H diff --git a/plugin/mms_plugin/include/MmsPluginDecode.h b/plugin/mms_plugin/include/MmsPluginDecode.h index aedb5e5..0e37b5a 100755 --- a/plugin/mms_plugin/include/MmsPluginDecode.h +++ b/plugin/mms_plugin/include/MmsPluginDecode.h @@ -17,15 +17,13 @@ #ifndef MMS_PLUGIN_DECODE_H #define MMS_PLUGIN_DECODE_H -#include "MmsPluginMessage.h" +#include "MmsPluginTypes.h" +#include "MmsPluginCodecTypes.h" typedef struct _MsgHeaderAddress MsgHeaderAddress; typedef int MmsMsgID; -/*================================================================================================== - Structures -==================================================================================================*/ typedef enum { MSG_PRESENTATION_NONE = -1, MSG_PRESENTATION_FIRSTPART, //Content-type == type parameter @@ -132,4 +130,4 @@ bool MmsDrm2ConvertMsgBody(char *szOriginFilePath); bool MmsDrm2ReadMsgConvertedBody(MSG_MESSAGE_INFO_S *pMsg, bool bSavePartsAsTempFiles, bool bRetrieved, char *retrievedPath); #endif -#endif +#endif //MMS_PLUGIN_DECODE_H diff --git a/plugin/mms_plugin/include/MmsPluginDrm.h b/plugin/mms_plugin/include/MmsPluginDrm.h index 6044337..860375e 100755 --- a/plugin/mms_plugin/include/MmsPluginDrm.h +++ b/plugin/mms_plugin/include/MmsPluginDrm.h @@ -14,15 +14,18 @@ * limitations under the License. */ +#ifndef MMS_PLUGIN_DRM_H +#define MMS_PLUGIN_DRM_H + #include "MsgMmsTypes.h" -#include "MmsPluginMessage.h" +#include "MmsPluginCodecTypes.h" #ifdef __SUPPORT_DRM__ #define MMS_DECODE_DRM_CONVERTED_TEMP_FILE MSG_DATA_PATH"Mms_Decode_Drm_Converted" #define MMS_MIMETYPELENGTH 50 -typedef enum { +typedef enum { MMS_DRM2_CONVERT_NONE, MMS_DRM2_CONVERT_NOT_FIXED, MMS_DRM2_CONVERT_REQUIRED, @@ -36,4 +39,7 @@ bool MsgDRM2GetDRMInfo(char *szFilePath, MsgType *pMsgType); bool MsgDRMIsForwardLockType(MsgDrmType drmType); bool MsgChangeDrm2FileName(char *szFileName); bool MsgIsDCFFile(char *szFilePath); -#endif + +#endif //__SUPPORT_DRM__ + +#endif //MMS_PLUGIN_DRM_H diff --git a/plugin/mms_plugin/include/MmsPluginEncode.h b/plugin/mms_plugin/include/MmsPluginEncode.h index b2de2d5..1537c9c 100755 --- a/plugin/mms_plugin/include/MmsPluginEncode.h +++ b/plugin/mms_plugin/include/MmsPluginEncode.h @@ -17,6 +17,7 @@ #ifndef MMS_PLUGIN_ENCODE_H #define MMS_PLUGIN_ENCODE_H +#include #include "MmsPluginCodecTypes.h" #include "MmsPluginCodecCommon.h" #include "MmsPluginMessage.h" @@ -33,4 +34,4 @@ bool MmsEncodeNotiRespInd(FILE *pFile, char *szTrID, msg_delivery_report_status_ bool MmsEncodeReadReport10(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus); bool MmsEncodeReadReport11(FILE *pFile, MmsMsg *pMsg, msg_read_report_status_t mmsReadStatus); -#endif +#endif //MMS_PLUGIN_ENCODE_H diff --git a/plugin/mms_plugin/include/MmsPluginEventHandler.h b/plugin/mms_plugin/include/MmsPluginEventHandler.h index 884c5b5..dbe9112 100755 --- a/plugin/mms_plugin/include/MmsPluginEventHandler.h +++ b/plugin/mms_plugin/include/MmsPluginEventHandler.h @@ -17,17 +17,9 @@ #ifndef MMS_PLUGIN_EVENT_HANDLER_H #define MMS_PLUGIN_EVENT_HANDLER_H - -/*================================================================================================== - INCLUDE FILES -==================================================================================================*/ #include "MsgPluginInterface.h" #include "MmsPluginTypes.h" -#include "MmsPluginMessage.h" -/*================================================================================================== - CLASS DEFINITIONS -==================================================================================================*/ class MmsPluginEventHandler { public: @@ -48,4 +40,3 @@ private: }; #endif //MMS_PLUGIN_EVENT_HANDLER_H - diff --git a/plugin/mms_plugin/include/MmsPluginHttp.h b/plugin/mms_plugin/include/MmsPluginHttp.h index 8bf279f..3686670 100755 --- a/plugin/mms_plugin/include/MmsPluginHttp.h +++ b/plugin/mms_plugin/include/MmsPluginHttp.h @@ -14,25 +14,35 @@ * limitations under the License. */ -#ifndef MMSPLUGINHTTP_H -#define MMSPLUGINHTTP_H +#ifndef MMS_PLUGIN_HTTP_H +#define MMS_PLUGIN_HTTP_H #include - -#include "MsgDebug.h" #include "MmsPluginTypes.h" -#include "MsgMutex.h" -#ifdef __cplusplus -extern "C" { -#endif +#define MSG_MMS_HH_CONTENT_TYPE "application/vnd.wap.mms-message" +#define MSG_MMS_HH_ACCEPT "application/vnd.wap.mms-message, */*" +#define MSG_MMS_HH_CHARSET "utf-8" +#define MSG_MMS_HH_LANGUAGE "zh-cn, en" +#define MSG_MMS_HH_ENCODING "deflate,gzip" +#define MSG_MMS_HH_USER_AGENT "Mozilla/5.0 (Linux; U; Tizen 1.0; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0" +#define MSG_MMS_WAP_PROFILE "" -#ifdef __cplusplus -} -#endif +typedef unsigned int MMS_HTTP_HEADER_FIELD_T; +enum _MMS_HTTP_HEADER_FIELD_E { + MMS_HH_CONTENT_TYPE, + MMS_HH_HOST, + MMS_HH_ACCEPT, + MMS_HH_ACCEPT_CHARSET, + MMS_HH_ACCEPT_LANGUAGE, + MMS_HH_ACCEPT_ENCODING, + MMS_HH_USER_AGENT, + MMS_HH_WAP_PROFILE +}; + class MmsPluginHttpAgent { public: @@ -62,28 +72,4 @@ class MmsPluginHttpAgent std::map httpCmdHandler; }; - -#define MSG_MMS_HH_CONTENT_TYPE "application/vnd.wap.mms-message" -#define MSG_MMS_HH_ACCEPT "application/vnd.wap.mms-message, */*" -#define MSG_MMS_HH_CHARSET "utf-8" -#define MSG_MMS_HH_LANGUAGE "zh-cn, en" -#define MSG_MMS_HH_ENCODING "deflate,gzip" - -#define MSG_MMS_HH_USER_AGENT "Mozilla/5.0 (Linux; U; Tizen 1.0; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0" -#define MSG_MMS_WAP_PROFILE "" - -typedef unsigned int MMS_HTTP_HEADER_FIELD_T; - - -enum _MMS_HTTP_HEADER_FIELD_E { - MMS_HH_CONTENT_TYPE, - MMS_HH_HOST, - MMS_HH_ACCEPT, - MMS_HH_ACCEPT_CHARSET, - MMS_HH_ACCEPT_LANGUAGE, - MMS_HH_ACCEPT_ENCODING, - MMS_HH_USER_AGENT, - MMS_HH_WAP_PROFILE -}; - -#endif +#endif //MMS_PLUGIN_HTTP_H diff --git a/plugin/mms_plugin/include/MmsPluginInternal.h b/plugin/mms_plugin/include/MmsPluginInternal.h index ada68bb..76c4e49 100755 --- a/plugin/mms_plugin/include/MmsPluginInternal.h +++ b/plugin/mms_plugin/include/MmsPluginInternal.h @@ -17,18 +17,9 @@ #ifndef MMS_PLUGIN_INTERNAL_H #define MMS_PLUGIN_INTERNAL_H -/*================================================================================================== - INCLUDE FILES -==================================================================================================*/ -#include "MsgStorageTypes.h" -#include "MsgTypes.h" -#include "MsgTransportTypes.h" -#include "MmsPluginMessage.h" #include "MmsPluginTypes.h" +#include "MmsPluginCodecTypes.h" -/*================================================================================================== - CLASS DEFINITIONS -==================================================================================================*/ class MmsPluginInternal { public: @@ -55,4 +46,5 @@ class MmsPluginInternal const char *getMmsDeliveryStatus(msg_delivery_report_status_t deliveryStatus); const char *getMmsReadStatus(msg_read_report_status_t readStatus); }; -#endif + +#endif //MMS_PLUGIN_INTERNAL_H diff --git a/plugin/mms_plugin/include/MmsPluginMIME.h b/plugin/mms_plugin/include/MmsPluginMIME.h index 29cefa9..6ad6fe1 100755 --- a/plugin/mms_plugin/include/MmsPluginMIME.h +++ b/plugin/mms_plugin/include/MmsPluginMIME.h @@ -14,14 +14,10 @@ * limitations under the License. */ -#ifndef _UTY_MIME_H_ -#define _UTY_MIME_H_ +#ifndef MMS_PLUGIN_MIME_H +#define MMS_PLUGIN_MIME_H -#include "MsgMmsTypes.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +#include "MmsPluginTypes.h" #define MSG_CH_CR '\r' #define MSG_CH_LF '\n' @@ -50,8 +46,6 @@ extern "C" { #define MSG_STR_DOUBLE_HYPEN "--" #define MSG_STR_BOUNDARY_DEL "\r\n--" -#define MSG_MMS_STR_ADDR_DELIMETER MSG_STR_ADDR_DELIMETER -#define MSG_MMS_CH_ADDR_DELIMETER MSG_CH_ADDR_DELIMETER #define MSG_MMS_CH_EMAIL_AT '@' @@ -275,10 +269,5 @@ char *MimeGetMimeStringFromMimeInt(int mimeType); char *MsgGetString(MsgHeaderField tableId, int code); char *_MsgSkipWS3(char *s); int _MsgGetCode(MsgHeaderField tableId, char *pStr); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif // _UTY_MIME_H_ - +#endif // MMS_PLUGIN_MIME_H diff --git a/plugin/mms_plugin/include/MmsPluginMain.h b/plugin/mms_plugin/include/MmsPluginMain.h index c01ec76..403f1b2 100755 --- a/plugin/mms_plugin/include/MmsPluginMain.h +++ b/plugin/mms_plugin/include/MmsPluginMain.h @@ -17,10 +17,7 @@ #ifndef MMS_PLUGIN_MAIN_H #define MMS_PLUGIN_MAIN_H -/*================================================================================================== - INCLUDE FILES -==================================================================================================*/ -#include "MsgTypes.h" +#include "MmsPluginTypes.h" #include "MsgPluginInterface.h" #ifdef __cplusplus @@ -29,9 +26,6 @@ extern "C" { #endif -/*================================================================================================== - FUNCTION PROTOTYPES -==================================================================================================*/ msg_error_t MmsInitialize(); msg_error_t MmsFinalize(); diff --git a/plugin/mms_plugin/include/MmsPluginMessage.h b/plugin/mms_plugin/include/MmsPluginMessage.h index 2dce303..57adb20 100755 --- a/plugin/mms_plugin/include/MmsPluginMessage.h +++ b/plugin/mms_plugin/include/MmsPluginMessage.h @@ -17,60 +17,30 @@ #ifndef MMS_PLUGIN_MESSAGE_H #define MMS_PLUGIN_MESSAGE_H - -/*================================================================================================== - INCLUDE FILES -==================================================================================================*/ -#include "MsgTypes.h" -#include "MsgInternalTypes.h" -#include "MsgMmsTypes.h" -#include "MsgSettingTypes.h" -#include "MmsPluginMIME.h" +#include "MmsPluginTypes.h" #include "MmsPluginCodec.h" -/*================================================================================================== - DEFINES -==================================================================================================*/ -#define MMS_TEXT_LEN 2000 -#define MMS_READ_REPORT_STRING_READ "Read:" -#define MMS_READ_REPORT_STRING_DELETED "Deleted:" - -#define MSG_ATTACH_MAX 20 -#define MSG_STR_ADDR_DELIMETER ";" -#define MSG_CH_ADDR_DELIMETER ';' -bool MmsInitMsgType(MsgType *pMsgType); -bool MmsInitMsgBody(MsgBody *pMsgBody); -bool MmsInitMsgContentParam(MsgContentParam *pMsgContentParam); -bool MmsInitMsgAttrib(MmsAttrib *pAttrib); bool MmsSetMsgAddressList(MmsAttrib *pAttrib, const MSG_MESSAGE_INFO_S *pMsgInfo); char *MmsComposeAddress(const MSG_MESSAGE_INFO_S *pMsgInfo, int recipientType); bool MmsGetMsgBodyfromMsgInfo(const MSG_MESSAGE_INFO_S *pMsgInfo, MMS_MESSAGE_DATA_S *pMsgBody, char *pFileData); bool MmsGetSmilRawData(MMS_MESSAGE_DATA_S *pMsgBody, char *pRawData, int *nSize); bool MmsInsertPresentation(MmsMsg *pMsg, MimeType mimeType, char *pData, int size); bool MmsInsertPartFromFile(MmsMsg *pMsg, char *szTitleName, char *szOrgFilePath, char *szContentID); -bool MmsIsMultipart(int type); bool MmsGetTypeByFileName(int *type, char *szFileName); MsgMultipart *MmsMakeMultipart(MimeType mimeType, char *szTitleName, char *szOrgFilePath, void *pData, int offset, int size, char *szContentID); + +bool MmsIsMultipart(int type); bool MmsIsText(int type); bool MmsIsVitemContent(int type, char *pszName); +MsgMultipart *MmsAllocMultipart(void); + bool MmsComposeMessage(MmsMsg *pMmsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_MESSAGE_DATA_S *pMsgData, char *pFileData); void MmsComposeNotiMessage(MmsMsg *pMmsMsg, msg_message_id_t msgID); -bool MmsGetMmsMessageBody(MmsMsg *pMmsMsg, char *retrievedFilePath); -bool MmsComposeForwardHeader(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo); -bool MmsComposeForwardMessage(MmsMsg *pMmsMsg, char *retrievedFilePath); -#ifdef MMS_DELIEVERY_IND_ENABLED -MmsMsgMultiStatus *MmsComposeDeliveryIndMessage(MmsMsg *pMmsMsg, msg_message_id_t msgId); -#endif void MmsComposeReadReportMessage(MmsMsg *pMmsMsg, const MSG_MESSAGE_INFO_S *pMsgInfo, msg_message_id_t selectedMsgId); -MmsMsgMultiStatus *MmsGetMultiStatus(msg_message_id_t msgId); int MmsSearchMsgId(char *toNumber, char *szMsgID); -MsgMultipart *MmsAllocMultipart(void); -msg_error_t MmsAddAttachment(MMS_MESSAGE_DATA_S *pMsgData, MMS_MEDIA_S *pMedia); bool MmsCheckAdditionalMedia(MMS_MESSAGE_DATA_S *pMsgData, MsgType *partHeader); bool MmsRemovePims(MMS_MESSAGE_DATA_S *pMsgData); -#ifdef __SUPPORT_DRM__ -bool __MsgInitMsgDRMInfo(MsgDRMInfo *pMsgDrmInfo); -#endif msg_error_t MmsMakePreviewInfo(int msgId, MMS_MESSAGE_DATA_S *pMmsMsg); -#endif + +#endif //MMS_PLUGIN_MESSAGE_H diff --git a/plugin/mms_plugin/include/MmsPluginSMILValidate.h b/plugin/mms_plugin/include/MmsPluginSMILValidate.h index 2ec4174..931e485 100755 --- a/plugin/mms_plugin/include/MmsPluginSMILValidate.h +++ b/plugin/mms_plugin/include/MmsPluginSMILValidate.h @@ -17,17 +17,8 @@ #ifndef MMS_PLUGIN_SMIL_VALIDATE_H #define MMS_PLUGIN_SMIL_VALIDATE_H - -/*================================================================================================== - * HEADER - *==================================================================================================*/ -#include "MsgTypes.h" #include "MsgMmsTypes.h" -#include "MmsPluginMessage.h" -/*================================================================================================== - * DEFINE - *==================================================================================================*/ /** * @brief Represents the default values of SMIL root layout. \n */ @@ -87,10 +78,6 @@ enum MSG_SMIL_ERR_E { MSG_SMIL_ERR_INVALID_PARAM, }; -/*================================================================================================== - * FUNCTIONS - *==================================================================================================*/ - /** @fn MSG_SMIL_ERR_E MsgMMSCreateSMIL(MMS_MESSAGE_DATA_S *pMsgData) * @brief Creates a SMIL buffer based on the Message handle. * @param pMsgData is Message handle. \n @@ -174,4 +161,4 @@ MSG_SMIL_ERR_E _MsgMMSAddDefaultFullSMILRegion(MMS_MESSAGE_DATA_S *pMsgData); */ MSG_SMIL_ERR_E _MsgMMSValidateSMILPage(MMS_MESSAGE_DATA_S *pMsgData, bool bRegAdded); -#endif // MMS_PLUGIN_SMIL_ENCODE_H +#endif //MMS_PLUGIN_SMIL_ENCODE_H diff --git a/plugin/mms_plugin/include/MmsPluginSmil.h b/plugin/mms_plugin/include/MmsPluginSmil.h index af94847..45029a9 100755 --- a/plugin/mms_plugin/include/MmsPluginSmil.h +++ b/plugin/mms_plugin/include/MmsPluginSmil.h @@ -14,17 +14,14 @@ * limitations under the License. */ -#include -#include -#include +#ifndef MMS_PLUGIN_SMIL_H +#define MMS_PLUGIN_SMIL_H + #include #include -#include "MsgTypes.h" -#include "MsgMmsTypes.h" -#include "MmsPluginCodec.h" -#ifndef MMS_PLUGIN_SMIL_H -#define MMS_PLUGIN_SMIL_H +#include "MsgMmsTypes.h" +#include "MmsPluginCodecTypes.h" typedef enum _SMIL_ELEMENT_T { ELEMENT_SMIL, @@ -262,5 +259,3 @@ char *__MmsSmilFindColorValue(int nValue); xmlNodePtr UtilxmlStringGetNodeList(xmlNodePtr pstNode, char *pszName); #endif//MMS_PLUGIN_SMIL_H - - diff --git a/plugin/mms_plugin/include/MmsPluginStorage.h b/plugin/mms_plugin/include/MmsPluginStorage.h index 797554b..12bdd61 100755 --- a/plugin/mms_plugin/include/MmsPluginStorage.h +++ b/plugin/mms_plugin/include/MmsPluginStorage.h @@ -17,16 +17,9 @@ #ifndef MMS_PLUGIN_STORAGE_H #define MMS_PLUGIN_STORAGE_H -/*================================================================================================== - INCLUDE FILES -==================================================================================================*/ -#include "MsgStorageTypes.h" #include "MsgSqliteWrapper.h" -#include "MmsPluginMessage.h" +#include "MmsPluginCodecTypes.h" -/*================================================================================================== - CLASS DEFINITIONS -==================================================================================================*/ class MmsPluginStorage { public: @@ -62,10 +55,9 @@ public: /* reject_msg_support */ msg_error_t getTrID(MSG_MESSAGE_INFO_S *pMsgInfo, char *pszTrID, int nBufferLen); /* reject_msg_support */ - + msg_error_t getAddressInfo(msg_message_id_t msgId, MSG_ADDRESS_INFO_S *pAddrInfo); msg_error_t updateMsgServerID(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo); - MmsMsgMultiStatus *getMultiStatus(msg_message_id_t msgId); msg_error_t getMsgText(MMS_MESSAGE_DATA_S *pMmsMsg, char *pMsgText); private: diff --git a/plugin/mms_plugin/include/MmsPluginTextConvert.h b/plugin/mms_plugin/include/MmsPluginTextConvert.h index 5f0741c..cacafbf 100755 --- a/plugin/mms_plugin/include/MmsPluginTextConvert.h +++ b/plugin/mms_plugin/include/MmsPluginTextConvert.h @@ -17,18 +17,8 @@ #ifndef MMS_PLUGIN_TEXT_CONVERT_H #define MMS_PLUGIN_TEXT_CONVERT_H -#include - -#ifdef __cplusplus -extern "C" { -#endif - const char *MmsPluginTextConvertGetCharSet(int MIBEnum); bool MmsPluginTextConvert(const char *pToCodeSet, const char *pFromCodeSet, const char *pSrc, int srcLen, char **ppDest, int *pDestLen); -#ifdef __cplusplus -} -#endif - -#endif +#endif //MMS_PLUGIN_TEXT_CONVERT_H diff --git a/plugin/mms_plugin/include/MmsPluginTransport.h b/plugin/mms_plugin/include/MmsPluginTransport.h index f619cdd..e6283f6 100755 --- a/plugin/mms_plugin/include/MmsPluginTransport.h +++ b/plugin/mms_plugin/include/MmsPluginTransport.h @@ -17,19 +17,8 @@ #ifndef MMS_PLUGIN_TRANSPORT_H #define MMS_PLUGIN_TRANSPORT_H - -/*================================================================================================== - INCLUDE FILES -==================================================================================================*/ -#include - -#include "MsgTransportTypes.h" #include "MmsPluginTypes.h" - -/*================================================================================================== - CLASS DEFINITIONS -==================================================================================================*/ class MmsPluginTransport { public: @@ -50,4 +39,3 @@ class MmsPluginTransport }; #endif //MMS_PLUGIN_TRANSPORT_H - diff --git a/plugin/mms_plugin/include/MmsPluginTypes.h b/plugin/mms_plugin/include/MmsPluginTypes.h index 03909e9..6f4f5bc 100755 --- a/plugin/mms_plugin/include/MmsPluginTypes.h +++ b/plugin/mms_plugin/include/MmsPluginTypes.h @@ -14,28 +14,28 @@ * limitations under the License. */ -#ifndef MMSTPDUTYPES_H -#define MMSTPDUTYPES_H +#ifndef MMS_PLUGIN_TYPES_H +#define MMS_PLUGIN_TYPES_H -#define __SUPPORT_LIBCURL__ - -#include "MmsPluginMessage.h" -#include "MsgStorageTypes.h" +#include "MsgTypes.h" +#include "MsgInternalTypes.h" +#define IN /*! Pfrefix*/ +#define OUT /*! Pfrefix*/ +#define INOUT /*! Pfrefix*/ -typedef enum _E_UA_STATE { - eUA_IDLE = 0, - eUA_READY, - eUA_WAITING -} E_UA_STATE; +#define RETRY_MAX 1 +#define MAX_MMSC_URL_LEN 100 +#define HTTP_REQUEST_LEN 1024 +#define MAX_URL_LENGTH 1024 +#define MAX_IPV4_LENGTH 30 typedef unsigned int MMS_NET_ERROR_T; - typedef unsigned int MMS_PDU_TYPE_T; - typedef unsigned char MMS_HTTP_CMD_TYPE_T; - +typedef unsigned int E_MMS_CONNECTION_MODE; +typedef unsigned int E_MMS_NETWORK_ACCESS_POINT; enum _MMS_NET_ERROR_E { eMMS_SUCCESS = 0, @@ -64,12 +64,6 @@ enum _MMS_NET_ERROR_E { eMMS_UNKNOWN }; -typedef struct _MMS_COND_S { - bool valid; - MMS_NET_ERROR_T reason; - -} MMS_COND_S; - enum _MMS_PDU_TYPE_E { eMMS_SEND_REQ = 0, eMMS_SEND_CONF, @@ -113,15 +107,6 @@ enum _MMS_HTTP_CMD_TYPE_E { eHTTP_CMD_DELETE_TRANSACTION }; -typedef enum { - MSG_CHECK_ADDR_TYPE_PHONE = 0x01, - MSG_CHECK_ADDR_TYPE_EMAIL = 0x02, - MSG_CHECK_ADDR_TYPE_IPV4 = 0x04, - MSG_CHECK_ADDR_TYPE_IPV6 = 0x08, - MSG_CHECK_ADDR_TYPE_NUM = 0x10, - MSG_CHECK_ADDR_TYPE_ALIAS = 0x20 -} MsgAddrCheckType; - typedef struct _mmsTranQEntity { bool isCompleted; msg_request_id_t reqID; @@ -141,51 +126,6 @@ typedef struct _mmsTranQEntity { char *pGetData; } mmsTranQEntity; -typedef enum { - MMS_RM_PDU_TYPE, - - MMS_RM_SEND_REQ, - MMS_RM_GET_REQ_AUTO, - MMS_RM_GET_REQ_MANUAL, - MMS_RM_NOTIFY_RESP_IND, - MMS_RM_ACK_IND, - - MMS_RM_NOTI_IND, - MMS_RM_RETRIEVE_CONF, - - MMS_RM_READ_REPORT_V10, - MMS_RM_READ_REPORT_V11 -} MmsRmPduType; - -/// CM ////////////////////////////////////////////////////// - -#define MAX_PROFILE_ID 1 - -#define MAX_URL_LENGTH 1024 -#define MAX_IPV4_LENGTH 30 - -typedef struct _MMS_NETWORK_PROFILE_S { - int profileId[MAX_PROFILE_ID]; - int profileCount; -} MMS_NETWORK_PROFILE_S; - - - -/// HTTP //////////////////////////////////////////////////// - -enum _E_MMS_CONNECTION_MODE { - eTCP_WITH_PROXY = 0, /** Means HTTP Proxy/Gateway are available */ - eTCP_WITHOUT_PROXY = 1 /** Means HTTP Proxy/Gateway is not available */ -}; - -typedef unsigned int E_MMS_CONNECTION_MODE; /**< Values from \ref _E_MMS_CONNECTION_MODE */ - -enum _E_MMS_NETWORK_ACCESS_POINT { - eNETWORK_ACCESS_POINT_ACKTIVE = 1 -}; - -typedef unsigned int E_MMS_NETWORK_ACCESS_POINT; - typedef struct _MMSC_CONFIG_DATA_S { char mmscUrl[MAX_URL_LENGTH + 1]; /** if break, change it to NETPM_HOME_URL_LEN_MAX */ char httpProxyIpAddr[MAX_IPV4_LENGTH + 1]; /** HTTP Proxy's URL or IP address */ @@ -216,76 +156,7 @@ typedef struct _MMS_PLUGIN_HTTP_CONTEXT_S { unsigned long bufOffset; /** < Incremented once received Content_receiving or Content_received Event */ } MMS_PLUGIN_HTTP_CONTEXT_S; -typedef struct _MMS_PLUGIN_PROCESS_DATA_S { - unsigned char *pData; - unsigned long dataLen; -} MMS_PLUGIN_PROCESS_DATA_S; - - -/////////////////////////////////////////////////////////////// - -#define RETRY_MAX 1 - -typedef enum { - MMS_HTTP_GET = 1, /* GET */ - MMS_HTTP_POST = 2 /* POST */ -} MMS_HTTP_METHOD; - -#define MAX_MMSC_URL_LEN 100 /** MAX URL Length includes NULL char */ -#define MAX_HTTP_PROXY_IPADDR_LEN 100 /** MAX HTTP Proxy IP addres length includes NULL char */ - -#define HTTP_REQUEST_LEN 1024 -#define HTTP_VER "HTTP/1.1" -#define CRLF "\r\n" -#define CRLFCRLF "\r\n\r\n" - -/* URL of IIS Server - Where CGI script located */ -#define IIS_PostURI "/mms/post.exe" -#define OperatorPostUrl "/mms/" -#define MAX_MMSC_IPADDR_LEN 512 -#define POST_URI OperatorPostUrl - - -////////////////////////////////////////////////////////// -#define HTTP_RESP_SUCCESS 200 -#define HTTP_PROB_RESP_SUCCESS 100 - - -#define MMS_HTTP_HDR_CONNECTION "Keep-Alive" - -/********* HTTP HEADER MACROS *********/ -#define MMS_HTTP_HDR_CONTENT_TYPE "application/vnd.wap.mms-message" - -#define MMS_HTTP_HDR_USER_AGENT "AX355" - -#define MMS_HTTP_HDR_ACCEPT "application/vnd.wap.mms-message" - -#define MMS_HTTP_HDR_ACCEPT_LANGUAGE "en" - -#define MMS_HTTP_HDR_ACCEPT_CHARSET "US-ASCII, ISO-8859-1, UTF-8" - -// MMSC Address -#define NOW_MMSC_URL "" -#define NOW_MMSC_IP "" -#define NOW_MMSC_PROXY "" -#define NOW_MMSC_PROXY_PORT - -#define DEFAULT_MMSC_URL NOW_MMSC_URL -#define DEFAULT_MMSC_IP NOW_MMSC_IP -#define DEFAULT_HTTP_PROXY NOW_MMSC_PROXY -#define DEFAULT_HTTP_PROXY_PORT NOW_MMSC_PROXY_PORT - -typedef struct _S_HTTP_UA_RECVING_DATA { - int curr_len_recv; - int total_data_len; -} S_HTTP_UA_RECVING_DATA; - -///////////////////////////////////////////////////// - -#define IN /*! Pfrefix*/ -#define OUT /*! Pfrefix*/ -#define INOUT /*! Pfrefix*/ -#endif +#endif //MMS_PLUGIN_TYPES_H diff --git a/plugin/mms_plugin/include/MmsPluginUserAgent.h b/plugin/mms_plugin/include/MmsPluginUserAgent.h index ec64e29..134b993 100755 --- a/plugin/mms_plugin/include/MmsPluginUserAgent.h +++ b/plugin/mms_plugin/include/MmsPluginUserAgent.h @@ -14,19 +14,13 @@ * limitations under the License. */ -#ifndef MMSPLUGINUSERAGENT_H -#define MMSPLUGINUSERAGENT_H +#ifndef MMS_PLUGIN_USERAGENT_H +#define MMS_PLUGIN_USERAGENT_H -#include -#include - -#include "MsgDebug.h" +#include "MsgThread.h" #include "MsgMutex.h" #include "MsgQueue.h" #include "MmsPluginTypes.h" -#include "MmsPluginConnManWrapper.h" -#include "MmsPluginHttp.h" -#include "MsgThread.h" class MmsPluginUaManager: public MsgThread { @@ -62,4 +56,4 @@ class MmsPluginUaManager: public MsgThread MsgThdSafeQ mmsTranQ; // transaction q for mms plugin }; -#endif // MMSPLUGINUSERAGENT_H +#endif //MMS_PLUGIN_USERAGENT_H diff --git a/plugin/mms_plugin/include/MmsPluginUtil.h b/plugin/mms_plugin/include/MmsPluginUtil.h index 1aa0d6d..d7348d6 100755 --- a/plugin/mms_plugin/include/MmsPluginUtil.h +++ b/plugin/mms_plugin/include/MmsPluginUtil.h @@ -17,14 +17,6 @@ #ifndef MMS_PLUGIN_UTIL_H #define MMS_PLUGIN_UTIL_H -/*================================================================================================== - INCLUDE FILES -==================================================================================================*/ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - bool makeImageThumbnail(char *srcPath, char *dstPath); bool makeVideoThumbnail(char *srcPath, char *dstPath); @@ -38,9 +30,4 @@ char *MsgStrNCopy(const char *string, int length); int MsgStrlen(char *pStr); bool MsgConvertCharToHex(char pSrc, char *pDest); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - #endif //MMS_PLUGIN_UTIL_H - diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 28c9085..cb0cd43 100755 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -51,6 +51,8 @@ FOREACH(flag ${utils_pkgs_CFLAGS}) ENDFOREACH(flag) ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DFEATURE_JAVA_MMS") +ADD_DEFINITIONS("-D__SUPPORT_DRM__") SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -- 2.7.4