2 * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include "MsgCppTypes.h"
22 #include "MsgException.h"
23 #include "MsgContact.h"
24 #include "MsgUtilFile.h"
25 #include "MsgGconfWrapper.h"
26 #include "MsgProxyListener.h"
27 #include "MsgHandle.h"
28 #include "MsgSqliteWrapper.h"
30 /*==================================================================================================
31 IMPLEMENTATION OF MsgHandle - Control Member Functions
32 ==================================================================================================*/
33 MsgHandle::MsgHandle() : mCounter(0), mClientSock()
35 memset(mConnectionId, 0x00, sizeof(mConnectionId));
36 memset(mCookie, 0x00, sizeof(mCookie));
40 MsgHandle::~MsgHandle()
45 void MsgHandle::openHandle()
49 MsgProxyListener::instance()->insertOpenHandleSet(this);
51 /* server is currently booting and service is not available until the end of booting */
52 MsgSettingGetBool(VCONFKEY_MSG_SERVER_READY, &bReady);
54 if (bReady == false) {
55 THROW(MsgException::SERVER_READY_ERROR, "Msg Server is not ready !!!!!");
57 MSG_INFO("Msg Server is ready !!!!!");
65 void MsgHandle::closeHandle(MsgHandle* pHandle)
69 /* Remove CB List of closing Handle */
70 MsgProxyListener* eventListener = MsgProxyListener::instance();
72 eventListener->clearListOfClosedHandle(pHandle);
73 /* eventListener->stop(); */
75 /* Close Socket IPC */
78 #ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
79 /* Close Contact Service */
80 if (MsgCloseContactSvc() != MSG_SUCCESS) {
81 MSG_WARN("Fail to close contact service.");
83 #endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
84 removeDbHandle(); /* unregister db handler */
90 void MsgHandle::connectSocket()
92 mClientSock.connect(MSG_SOCKET_PATH);
96 void MsgHandle::disconnectSocket()
102 void MsgHandle::write(const char *pCmdData, int cmdSize, char **ppEvent)
104 if (pCmdData == NULL || ppEvent == NULL) {
105 THROW(MsgException::INVALID_PARAM, "Param is NULL");
110 /* Send Command to MSG FW */
111 MutexLocker lock(mx);
112 ret = mClientSock.write(pCmdData, cmdSize);
114 THROW(MsgException::IPC_ERROR, "IPC write error");
116 char *tmpEvent = NULL;
119 /* Receive Result from MSG FW */
122 if (tmpEvent == NULL) {
123 MSG_DEBUG("Event Data is NULL!!");
127 if (!CheckEventData(tmpEvent)) {
138 void MsgHandle::read(char **ppEvent)
140 unsigned int dataSize = 0;
142 int ret = mClientSock.read(ppEvent, &dataSize);
144 if (ret == CLOSE_CONNECTION_BY_SIGNAL) {
145 THROW(MsgException::IPC_ERROR, "Server closed connection");
150 void MsgHandle::convertMsgStruct(const MSG_MESSAGE_HIDDEN_S *pSrc, MSG_MESSAGE_INFO_S *pDest)
154 pDest->msgId = pSrc->msgId;
155 pDest->threadId = pSrc->threadId;
156 pDest->folderId = pSrc->folderId;
157 pDest->msgType.mainType = pSrc->mainType;
158 pDest->msgType.subType = pSrc->subType;
159 pDest->msgType.classType = pSrc->classType;
160 pDest->storageId = pSrc->storageId;
162 if (g_list_length(pSrc->addressList) > 0) {
163 msg_struct_s *addr_info = NULL;
164 MSG_ADDRESS_INFO_S *address = NULL;
166 pDest->nAddressCnt = g_list_length(pSrc->addressList);
167 pDest->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S) * pDest->nAddressCnt];
168 memset(pDest->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S) * pDest->nAddressCnt);
170 for (int i = 0; i < pDest->nAddressCnt; i++) {
171 addr_info = (msg_struct_s *)g_list_nth_data(pSrc->addressList, (guint)i);
172 address = (MSG_ADDRESS_INFO_S *)addr_info->data;
174 pDest->addressList[i].addressType = address->addressType;
175 pDest->addressList[i].recipientType = address->recipientType;
176 pDest->addressList[i].contactId = address->contactId;
177 strncpy(pDest->addressList[i].addressVal, address->addressVal, MAX_ADDRESS_VAL_LEN);
178 strncpy(pDest->addressList[i].displayName, address->displayName, MAX_DISPLAY_NAME_LEN);
181 msg_struct_list_s *addr_info_s = pSrc->addr_list;
183 if (addr_info_s && (addr_info_s->nCount > 0)) {
184 msg_struct_s *addr_info = NULL;
185 MSG_ADDRESS_INFO_S *address = NULL;
187 pDest->nAddressCnt = addr_info_s->nCount;
189 pDest->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S) * addr_info_s->nCount];
190 memset(pDest->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S) * addr_info_s->nCount);
192 for (int i = 0; i < addr_info_s->nCount; i++) {
193 addr_info = (msg_struct_s *)addr_info_s->msg_struct_info[i];
195 address = (MSG_ADDRESS_INFO_S *)addr_info->data;
197 pDest->addressList[i].addressType = address->addressType;
198 pDest->addressList[i].recipientType = address->recipientType;
199 pDest->addressList[i].contactId = address->contactId;
200 strncpy(pDest->addressList[i].addressVal, address->addressVal, MAX_ADDRESS_VAL_LEN);
201 strncpy(pDest->addressList[i].displayName, address->displayName, MAX_DISPLAY_NAME_LEN);
206 strncpy(pDest->replyAddress, pSrc->replyAddress, MAX_PHONE_NUMBER_LEN);
207 strncpy(pDest->subject, pSrc->subject, MAX_SUBJECT_LEN);
209 pDest->displayTime = pSrc->displayTime;
210 pDest->networkStatus = pSrc->networkStatus;
211 pDest->encodeType = pSrc->encodeType;
212 pDest->bRead = pSrc->bRead;
213 pDest->bProtected = pSrc->bProtected;
214 pDest->bBackup = pSrc->bBackup;
215 pDest->priority = pSrc->priority;
216 pDest->direction = pSrc->direction;
219 pDest->msgPort.valid = pSrc->bPortValid;
221 if (pDest->msgPort.valid == true) {
222 pDest->msgPort.dstPort = pSrc->dstPort;
223 pDest->msgPort.srcPort = pSrc->srcPort;
226 MSG_DEBUG("nSize = %d", pSrc->dataSize);
227 MSG_DEBUG("mainType = %d", pSrc->mainType);
229 if (pSrc->mainType == MSG_SMS_TYPE) {
230 if (pSrc->pData != NULL) {
231 pDest->bTextSms = true;
232 pDest->dataSize = pSrc->dataSize;
234 memset(pDest->msgText, 0x00, sizeof(pDest->msgText));
236 if (pSrc->dataSize > MAX_MSG_TEXT_LEN) {
237 /* Save Message Data into File */
238 char fileName[MSG_FILENAME_LEN_MAX+1];
239 memset(fileName, 0x00, sizeof(fileName));
241 if (MsgCreateFileName(fileName) == false)
242 THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
244 MSG_SEC_DEBUG("Save pSrc->pData into file : size[%d] name[%s]", pDest->dataSize, fileName);
246 if (MsgWriteIpcFile(fileName, (char*)pSrc->pData, pSrc->dataSize) == false)
247 THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
249 memset(pDest->msgData, 0x00, sizeof(pDest->msgData));
250 strncpy(pDest->msgData, fileName, MAX_MSG_DATA_LEN);
252 pDest->bTextSms = false;
255 if (pDest->encodeType == MSG_ENCODE_8BIT)
256 memcpy(pDest->msgText, pSrc->pData, pSrc->dataSize);
258 strncpy(pDest->msgText, (char*)pSrc->pData, pSrc->dataSize);
261 MSG_DEBUG("pData = %s", pSrc->pData);
263 MSG_DEBUG("pSrc->pData is NULL.");
264 pDest->bTextSms = true;
268 MSG_SEC_DEBUG("msgText = %s", pDest->msgText);
269 } else if (pSrc->mainType == MSG_MMS_TYPE) {
270 pDest->bTextSms = false;
271 pDest->dataSize = pSrc->dataSize;
273 if (pSrc->subType == MSG_READREPLY_MMS) {
274 memset(pDest->msgData, 0x00, sizeof(pDest->msgData));
276 if (pSrc->mmsDataSize < MAX_MSG_DATA_LEN)
277 memcpy(pDest->msgData, pSrc->pMmsData, pSrc->mmsDataSize);
279 memcpy(pDest->msgData, pSrc->pMmsData, MAX_MSG_DATA_LEN);
282 /* Save Message Data into File */
283 char fileName[MSG_FILENAME_LEN_MAX+1];
284 memset(fileName, 0x00, sizeof(fileName));
286 if (MsgCreateFileName(fileName) == false)
287 THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
289 /* change file extension in case of java MMS msg */
290 if (pSrc->subType == MSG_SENDREQ_JAVA_MMS) {
291 char* pFileNameExt = NULL;
292 pFileNameExt = strstr(fileName, "DATA");
294 snprintf(pFileNameExt, strlen("JAVA")+1, "JAVA");
297 MSG_SEC_DEBUG("Save Message Data into file : size[%d] name[%s]", pSrc->mmsDataSize, fileName);
298 if (MsgWriteIpcFile(fileName, (char*)pSrc->pMmsData, pSrc->mmsDataSize) == false)
299 THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
301 memset(pDest->msgData, 0x00, sizeof(pDest->msgData));
302 strncpy(pDest->msgData, fileName, MAX_MSG_DATA_LEN);
304 strncpy(pDest->msgText, (char*)pSrc->pData, MAX_MSG_TEXT_LEN);
307 if (strlen(pSrc->thumbPath) > 0) {
308 memset(pDest->thumbPath, 0x00, sizeof(pDest->thumbPath));
309 memcpy(pDest->thumbPath, pSrc->thumbPath, sizeof(pDest->thumbPath));
314 pDest->sim_idx = pSrc->simIndex;
320 void MsgHandle::convertMsgStruct(const MSG_MESSAGE_INFO_S *pSrc, MSG_MESSAGE_HIDDEN_S *pDest)
324 pDest->msgId = pSrc->msgId;
325 pDest->threadId = pSrc->threadId;
326 pDest->folderId = pSrc->folderId;
327 pDest->mainType = pSrc->msgType.mainType;
328 pDest->subType = pSrc->msgType.subType;
329 pDest->storageId = pSrc->storageId;
331 strncpy(pDest->replyAddress, pSrc->replyAddress, MAX_PHONE_NUMBER_LEN);
332 strncpy(pDest->subject, pSrc->subject, MAX_SUBJECT_LEN);
334 pDest->displayTime = pSrc->displayTime;
335 pDest->networkStatus = pSrc->networkStatus;
336 pDest->encodeType = pSrc->encodeType;
337 pDest->bRead = pSrc->bRead;
338 pDest->bProtected = pSrc->bProtected;
339 pDest->bBackup = pSrc->bBackup;
340 pDest->priority = pSrc->priority;
341 pDest->direction = pSrc->direction;
342 pDest->simIndex = pSrc->sim_idx;
345 pDest->bPortValid = pSrc->msgPort.valid;
347 if (pDest->bPortValid == true) {
348 pDest->dstPort = pSrc->msgPort.dstPort;
349 pDest->srcPort = pSrc->msgPort.srcPort;
352 if (pSrc->thumbPath[0] != '\0')
353 strncpy(pDest->thumbPath, pSrc->thumbPath, MSG_FILEPATH_LEN_MAX);
355 int maxCnt = (pSrc->nAddressCnt > 10)? MAX_TO_ADDRESS_CNT: pSrc->nAddressCnt;
357 pDest->addr_list->nCount = maxCnt;
359 msg_struct_s *addr_info_s = NULL;
360 MSG_ADDRESS_INFO_S *addr_info = NULL;
362 for (int i = 0; i < maxCnt; i++) {
363 addr_info_s = (msg_struct_s *)pDest->addr_list->msg_struct_info[i];
364 addr_info = (MSG_ADDRESS_INFO_S *)addr_info_s->data;
366 addr_info->addressType = pSrc->addressList[i].addressType;
367 addr_info->recipientType = pSrc->addressList[i].recipientType;
368 addr_info->contactId = pSrc->addressList[i].contactId;
369 strncpy(addr_info->addressVal, pSrc->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN);
370 strncpy(addr_info->displayName, pSrc->addressList[i].displayName, MAX_DISPLAY_NAME_LEN);
371 addr_info->displayName[MAX_DISPLAY_NAME_LEN] = '\0';
374 for (int i = 0; i < pSrc->nAddressCnt; i++) {
375 addr_info_s = new msg_struct_s;
376 memset(addr_info_s, 0x00, sizeof(msg_struct_s));
378 addr_info_s->type = MSG_STRUCT_ADDRESS_INFO;
379 addr_info_s->data = new MSG_ADDRESS_INFO_S;
380 memset(addr_info_s->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
382 addr_info = (MSG_ADDRESS_INFO_S *)addr_info_s->data;
384 addr_info->addressType = pSrc->addressList[i].addressType;
385 addr_info->recipientType = pSrc->addressList[i].recipientType;
386 addr_info->contactId = pSrc->addressList[i].contactId;
387 strncpy(addr_info->addressVal, pSrc->addressList[i].addressVal, MAX_ADDRESS_VAL_LEN);
388 strncpy(addr_info->displayName, pSrc->addressList[i].displayName, MAX_DISPLAY_NAME_LEN);
389 addr_info->displayName[MAX_DISPLAY_NAME_LEN] = '\0';
391 pDest->addressList = g_list_append(pDest->addressList, addr_info_s);
395 if (pSrc->bTextSms == false) {
398 char* pFileData = NULL;
399 unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
401 pDest->dataSize = pSrc->dataSize;
403 /* Get Message Data from File */
404 if (MsgOpenAndReadFile(pSrc->msgData, &pFileData, &fileSize) == false)
405 THROW(MsgException::FILE_ERROR, "MsgOpenAndReadFile error");
407 if (pSrc->msgType.mainType == MSG_SMS_TYPE) {
408 if (pDest->encodeType == MSG_ENCODE_8BIT) {
409 pDest->pData = (void*)new char[fileSize];
410 memset(pDest->pData, 0x00, fileSize);
411 memcpy(pDest->pData, pFileData, fileSize);
413 pDest->pData = (void*)new char[fileSize+1];
414 memset(pDest->pData, 0x00, fileSize+1);
415 strncpy((char*)pDest->pData, pFileData, fileSize);
418 if (pSrc->msgText[0] != '\0') {
419 pDest->pData = (void*)new char[strlen(pSrc->msgText)+1];
420 memset(pDest->pData, 0x00, strlen(pSrc->msgText)+1);
421 strncpy((char*)pDest->pData, pSrc->msgText, strlen(pSrc->msgText));
423 pDest->mmsDataSize = fileSize;
424 pDest->pMmsData = (void*)new char[fileSize];
425 memset(pDest->pMmsData, 0x00, fileSize);
426 memcpy(pDest->pMmsData, pFileData, fileSize);
427 MSG_SEC_DEBUG("Get Message Data from file : size[%d] name[%s]", pDest->mmsDataSize, pSrc->msgData);
431 pDest->dataSize = pSrc->dataSize;
433 if (pSrc->msgType.mainType == MSG_SMS_TYPE) {
434 if (pDest->encodeType == MSG_ENCODE_8BIT || pSrc->msgType.subType == MSG_ETWS_SMS) {
435 pDest->pData = (void*)new char[pDest->dataSize];
436 memset(pDest->pData, 0x00, pDest->dataSize);
437 memcpy(pDest->pData, pSrc->msgText, pDest->dataSize);
439 pDest->pData = (void*)new char[pDest->dataSize+1];
440 memset(pDest->pData, 0x00, pDest->dataSize+1);
441 strncpy((char*)pDest->pData, pSrc->msgText, pDest->dataSize);
444 if (pSrc->msgText[0] != '\0') {
445 pDest->pData = (void*)new char[strlen(pSrc->msgText)+1];
446 memset(pDest->pData, 0x00, strlen(pSrc->msgText)+1);
447 strncpy((char*)pDest->pData, pSrc->msgText, strlen(pSrc->msgText));
450 pDest->mmsDataSize = pDest->dataSize;
451 pDest->pMmsData = (void*)new char[pDest->dataSize];
452 memset(pDest->pMmsData, 0x00, pDest->dataSize);
453 memcpy(pDest->pMmsData, pSrc->msgData, pDest->dataSize);
461 void MsgHandle::convertSendOptStruct(const MSG_SENDINGOPT_S* pSrc, MSG_SENDINGOPT_INFO_S* pDest, MSG_MESSAGE_TYPE_S msgType)
465 pDest->bSetting = pSrc->bSetting;
467 if (pSrc->bSetting == false) {
468 MSG_DEBUG("No Sending Option");
472 pDest->bDeliverReq = pSrc->bDeliverReq;
473 pDest->bKeepCopy = pSrc->bKeepCopy;
475 MSG_DEBUG("pDest->bSetting = %d", pDest->bSetting);
476 MSG_DEBUG("pDest->bDeliverReq = %d", pDest->bDeliverReq);
477 MSG_DEBUG("pDest->bKeepCopy = %d", pDest->bKeepCopy);
479 if (msgType.mainType == MSG_SMS_TYPE) {
480 msg_struct_s *pStruct = (msg_struct_s *)pSrc->smsSendOpt;
482 SMS_SENDINGOPT_S *pSms = (SMS_SENDINGOPT_S *)pStruct->data;
484 pDest->option.smsSendOptInfo.bReplyPath = pSms->bReplyPath;
487 } else if (msgType.mainType == MSG_MMS_TYPE) {
488 msg_struct_s *pStruct = (msg_struct_s *)pSrc->mmsSendOpt;
490 MMS_SENDINGOPT_S *pMms = (MMS_SENDINGOPT_S *)pStruct->data;
492 pDest->option.mmsSendOptInfo.priority = pMms->priority;
493 pDest->option.mmsSendOptInfo.bReadReq = pMms->bReadReq;
495 MSG_DEBUG("pDest->option.mmsSendOpt.priority = %d", pMms->priority);
496 MSG_DEBUG("pDest->option.mmsSendOpt.bReadReq = %d", pMms->bReadReq);
498 if (pMms->expiryTime == 0) {
499 pDest->option.mmsSendOptInfo.expiryTime.type = MMS_TIMETYPE_NONE;
500 pDest->option.mmsSendOptInfo.expiryTime.time = pMms->expiryTime;
502 pDest->option.mmsSendOptInfo.expiryTime.type = MMS_TIMETYPE_RELATIVE;
503 pDest->option.mmsSendOptInfo.expiryTime.time = pMms->expiryTime;
506 if (pMms->bUseDeliveryCustomTime == true) {
507 pDest->option.mmsSendOptInfo.bUseDeliveryCustomTime = true;
509 pDest->option.mmsSendOptInfo.bUseDeliveryCustomTime = false;
511 pDest->option.mmsSendOptInfo.deliveryTime.type = MMS_TIMETYPE_RELATIVE;
512 pDest->option.mmsSendOptInfo.deliveryTime.time = pMms->deliveryTime;
514 MSG_DEBUG("pDest->option.mmsSendOpt.expiryTime = %d", pDest->option.mmsSendOptInfo.expiryTime.time);
523 void MsgHandle::convertSendOptStruct(const MSG_SENDINGOPT_INFO_S* pSrc, MSG_SENDINGOPT_S* pDest, MSG_MESSAGE_TYPE_S msgType)
527 pDest->bDeliverReq = pSrc->bDeliverReq;
528 pDest->bKeepCopy = pSrc->bKeepCopy;
530 MSG_DEBUG("pDest->bDeliverReq = %d", pDest->bDeliverReq);
531 MSG_DEBUG("pDest->bKeepCopy = %d", pDest->bKeepCopy);
533 if (msgType.mainType == MSG_SMS_TYPE) {
534 msg_struct_s *pStruct = (msg_struct_s *)pDest->smsSendOpt;
535 SMS_SENDINGOPT_S *pSms = (SMS_SENDINGOPT_S *)pStruct->data;
536 pSms->bReplyPath = pSrc->option.smsSendOptInfo.bReplyPath;
537 } else if (msgType.mainType == MSG_MMS_TYPE) {
538 msg_struct_s *pStruct = (msg_struct_s *)pDest->mmsSendOpt;
539 MMS_SENDINGOPT_S *pMms = (MMS_SENDINGOPT_S *)pStruct->data;
540 pMms->priority = pSrc->option.mmsSendOptInfo.priority;
541 pMms->bReadReq = pSrc->option.mmsSendOptInfo.bReadReq;
542 pMms->expiryTime = pSrc->option.mmsSendOptInfo.expiryTime.time;
543 pMms->deliveryTime = pSrc->option.mmsSendOptInfo.deliveryTime.time;
545 MSG_DEBUG("pDest->option.mmsSendOpt.priority = %d", pMms->priority);
546 MSG_DEBUG("pDest->option.mmsSendOpt.bReadReq = %d", pMms->bReadReq);
547 MSG_DEBUG("pDest->option.mmsSendOpt.expiryTime = %d", pMms->expiryTime);
554 int MsgHandle::getSettingCmdSize(MSG_OPTION_TYPE_T optionType)
556 int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_OPTION_TYPE_T);
558 switch (optionType) {
559 case MSG_GENERAL_OPT:
560 cmdSize += sizeof(MSG_GENERAL_OPT_S);
562 case MSG_SMS_SENDOPT:
563 cmdSize += sizeof(MSG_SMS_SENDOPT_S);
566 cmdSize += sizeof(MSG_SMSC_LIST_S);
568 case MSG_MMS_SENDOPT:
569 cmdSize += sizeof(MSG_MMS_SENDOPT_S);
571 case MSG_MMS_RECVOPT:
572 cmdSize += sizeof(MSG_MMS_RECVOPT_S);
574 case MSG_MMS_STYLEOPT:
575 cmdSize += sizeof(MSG_MMS_STYLEOPT_S);
577 case MSG_PUSHMSG_OPT:
578 cmdSize += sizeof(MSG_PUSHMSG_OPT_S);
581 cmdSize += sizeof(MSG_CBMSG_OPT_S);
583 case MSG_VOICEMAIL_OPT:
584 cmdSize += sizeof(MSG_VOICEMAIL_OPT_S);
586 case MSG_MSGSIZE_OPT:
587 cmdSize += sizeof(MSG_MSGSIZE_OPT_S);
595 bool MsgHandle::CheckEventData(char *pEventData)
597 MSG_EVENT_S* pEvent = (MSG_EVENT_S*)pEventData;
599 switch (pEvent->eventType) {
600 case MSG_EVENT_PLG_SENT_STATUS_CNF:
601 case MSG_EVENT_PLG_INCOMING_MSG_IND:
602 case MSG_EVENT_PLG_INCOMING_MMS_CONF:
603 case MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND:
604 case MSG_EVENT_PLG_INCOMING_LBS_MSG_IND:
605 case MSG_EVENT_PLG_STORAGE_CHANGE_IND:
606 case MSG_EVENT_PLG_INCOMING_CB_MSG_IND:
607 case MSG_EVENT_PLG_INCOMING_PUSH_MSG_IND:
608 case MSG_EVENT_PLG_REPORT_MSG_INCOMING_IND: