update tizen source
[framework/messaging/msg-service.git] / plugin / sms_plugin / SmsPluginSatHandler.cpp
1 /*
2 *
3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
4 *
5 * This file is part of msg-service.
6 *
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 *          Sangkoo Kim <sangkoo.kim@samsung.com>
9 *          Seunghwan Lee <sh.cat.lee@samsung.com>
10 *          SoonMin Jung <sm0415.jung@samsung.com>
11 *          Jae-Young Lee <jy4710.lee@samsung.com>
12 *          KeeBum Kim <keebum.kim@samsung.com>
13 *
14 * PROPRIETARY/CONFIDENTIAL
15 *
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
21 *
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
28 *
29 */
30
31 #include "MsgDebug.h"
32 #include "MsgCppTypes.h"
33 #include "MsgException.h"
34 #include "MsgGconfWrapper.h"
35 #include "SmsPluginParamCodec.h"
36 #include "SmsPluginUDCodec.h"
37 #include "SmsPluginSetting.h"
38 #include "SmsPluginTransport.h"
39 #include "SmsPluginEventHandler.h"
40 #include "SmsPluginSatHandler.h"
41
42 extern "C"
43 {
44         #include <ITapiNetText.h>
45         #include <ITapiSat.h>
46 }
47
48 /*==================================================================================================
49                                      IMPLEMENTATION OF SmsPluginCbMsgHandler - Member Functions
50 ==================================================================================================*/
51 SmsPluginSatHandler* SmsPluginSatHandler::pInstance = NULL;
52
53
54 SmsPluginSatHandler::SmsPluginSatHandler()
55 {
56         commandId = 0;
57
58         bSendSms = false;
59         bInitSim = false;
60         bSMSPChanged = false;
61         bCBMIChanged = false;
62 }
63
64
65 SmsPluginSatHandler::~SmsPluginSatHandler()
66 {
67
68 }
69
70
71 SmsPluginSatHandler* SmsPluginSatHandler::instance()
72 {
73         if (!pInstance)
74                 pInstance = new SmsPluginSatHandler();
75
76         return pInstance;
77 }
78
79
80 void SmsPluginSatHandler::refreshSms(void *pData)
81 {
82         TelSatRefreshInd_t* pRefreshData = (TelSatRefreshInd_t*)pData;
83
84         if (pRefreshData->appType != TAPI_SAT_REFRESH_MSG)
85         {
86                 MSG_DEBUG("App Type is wrong. [%d]", pRefreshData->appType);
87                 return;
88         }
89
90         commandId = pRefreshData->commandId;
91
92         switch (pRefreshData->refreshMode)
93         {
94                 case TAPI_SAT_REFRESH_SIM_INIT_AND_FULL_FCN :
95                 case TAPI_SAT_REFRESH_SIM_INIT_AND_FCN :
96                 {
97                         for (int i = 0; i < pRefreshData->fileCount; i++)
98                         {
99                                 if ((SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_USIM_SMSP ||
100                                         (SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_SMSP)
101                                 {
102                                         bSMSPChanged = true;
103                                 }
104                                 else if ((SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_USIM_CBMI ||
105                                         (SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_CBMI)
106                                 {
107                                         bCBMIChanged = true;
108                                 }
109                         }
110
111                         initSim();
112                 }
113                 break;
114
115                 case TAPI_SAT_REFRESH_FCN :
116                 {
117                         for (int i = 0; i < pRefreshData->fileCount; i++)
118                         {
119                                 if ((SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_USIM_SMSP ||
120                                         (SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_SMSP)
121                                 {
122                                         bSMSPChanged = true;
123                                 }
124                                 else if ((SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_USIM_CBMI ||
125                                         (SMS_SIM_EFILE_NAME_T)pRefreshData->fileId[i].FileName == SMS_SIM_EFILE_CBMI)
126                                 {
127                                         bCBMIChanged = true;
128                                 }
129                         }
130                 }
131                 break;
132
133                 case TAPI_SAT_REFRESH_SIM_INIT :
134                 {
135                         initSim();
136                 }
137                 break;
138
139                 default:
140                 break;
141         }
142 }
143
144
145 void SmsPluginSatHandler::sendSms(void *pData)
146 {
147         TelSatSendSmsIndSmsData_t* pSmsData = (TelSatSendSmsIndSmsData_t*)pData;
148
149         bSendSms = true;
150
151         commandId = pSmsData->commandId;
152
153         MSG_DEBUG("commandId [%d]", commandId);
154
155         // The TPDU Maximum Length at SAT side is 175
156         // This is because Sat can send 160 bytes unpacked and header
157         unsigned char tpdu[MAX_SAT_TPDU_LEN+1];
158         int tpduLen = 0;
159
160         memset(tpdu, 0x00, sizeof(tpdu));
161         memcpy(tpdu, pSmsData->smsTpdu.data, pSmsData->smsTpdu.dataLen);
162
163         // Modify Parameters, Pack User Data
164         tpduLen = handleSatTpdu(tpdu, pSmsData->smsTpdu.dataLen, pSmsData->bIsPackingRequired);
165
166         if (tpduLen <= 0 || tpduLen > MAX_TPDU_DATA_LEN)
167         {
168                 sendResult(SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_BEYOND_ME_CAPABILITIES);
169                 return;
170         }
171
172         // Make Telephony Structure
173         TelSmsDatapackageInfo_t pkgInfo;
174
175         // Set TPDU data
176         memset((void*)pkgInfo.szData, 0x00, sizeof(pkgInfo.szData));
177         memcpy((void*)pkgInfo.szData, tpdu, tpduLen);
178
179         pkgInfo.szData[tpduLen] = '\0';
180         pkgInfo.MsgLength = tpduLen;
181
182         // Set SMSC Address
183         SMS_ADDRESS_S smsc;
184
185         if (pSmsData->address.diallingNumberLen > 0)
186         {
187                 smsc.ton = pSmsData->address.ton;
188                 smsc.npi = pSmsData->address.npi;
189                 memcpy(smsc.address, pSmsData->address.diallingNumber, pSmsData->address.diallingNumberLen);
190                 smsc.address[pSmsData->address.diallingNumberLen] = '\0';
191
192                 MSG_DEBUG("SCA TON[%d], NPI[%d], LEN[%d], ADDR[%s]", smsc.ton, smsc.npi, strlen(smsc.address), smsc.address);
193         }
194         else
195         {
196                 // Set SMSC Options
197                 SmsPluginTransport::instance()->setSmscOptions(&smsc);
198         }
199
200         unsigned char smscAddr[MAX_SMSC_LEN];
201         memset(smscAddr, 0x00, sizeof(smscAddr));
202
203         int smscLen = SmsPluginParamCodec::encodeSMSC(&smsc, smscAddr);
204
205         if (smscLen <= 0) return;
206
207         // Set SMSC Address
208         memset(pkgInfo.Sca, 0x00, sizeof(pkgInfo.Sca));
209         memcpy((void*)pkgInfo.Sca, smscAddr, smscLen);
210         pkgInfo.Sca[smscLen] = '\0';
211
212         int reqId = 0, tapiRet = TAPI_API_SUCCESS;
213
214         // Send SMS
215         tapiRet = tel_send_sms(&pkgInfo, 0, &reqId);
216
217         if (tapiRet == TAPI_API_SUCCESS)
218         {
219                 MSG_DEBUG("########  TelTapiSmsSend Success !!! return : %d #######", tapiRet);
220         }
221         else
222         {
223                 MSG_DEBUG("########  TelTapiSmsSend Fail !!! return : %d #######", tapiRet);
224                 sendResult(SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_BEYOND_ME_CAPABILITIES);
225         }
226 }
227
228
229 void SmsPluginSatHandler::ctrlSms(void *pData)
230 {
231         TelSatMoSmCtrlIndData_t* pCtrlData = (TelSatMoSmCtrlIndData_t*)pData;
232
233         if (bSendSms == true) // Send SMS By SAT
234         {
235                 if (pCtrlData->moSmsCtrlResult == TAPI_SAT_CALL_CTRL_R_NOT_ALLOWED)
236                 {
237                         MSG_DEBUG("SIM does not allow to send SMS");
238
239                         sendResult(SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM);
240                 }
241                 else if (pCtrlData->moSmsCtrlResult == TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD)
242                 {
243                         MSG_DEBUG("SIM allows to send SMS with modification");
244
245                         sendResult(SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_SUCCESS);
246                 }
247         }
248         else // Send SMS By APP
249         {
250                 MSG_NETWORK_STATUS_T netStatus = MSG_NETWORK_NOT_SEND;
251
252                 if (pCtrlData->moSmsCtrlResult == TAPI_SAT_CALL_CTRL_R_NOT_ALLOWED)
253                 {
254                         MSG_DEBUG("SIM does not allow to send SMS");
255
256                         netStatus = MSG_NETWORK_SEND_FAIL;
257                 }
258                 else if (pCtrlData->moSmsCtrlResult == TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD)
259                 {
260                         MSG_DEBUG("SIM allows to send SMS with modification");
261
262                         netStatus = MSG_NETWORK_SEND_SUCCESS;
263                 }
264
265                 // Call Event Handler
266                 SmsPluginEventHandler::instance()->handleSentStatus(-1, netStatus);
267         }
268 }
269
270
271 void SmsPluginSatHandler::ctrlSms(MSG_NETWORK_STATUS_T netStatus)
272 {
273         if (bSendSms == true) // Send SMS By SAT
274         {
275                 if (netStatus == MSG_NETWORK_SEND_SUCCESS)
276                 {
277                         MSG_DEBUG("Sending SMS by SAT is OK");
278
279                         sendResult(SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_SUCCESS);
280                 }
281                 else if (netStatus == MSG_NETWORK_SEND_FAIL)
282                 {
283                         MSG_DEBUG("Sending SMS by SAT is failed");
284
285                         sendResult(SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_SMS_RP_ERROR);
286                 }
287         }
288 }
289
290
291 void SmsPluginSatHandler::finishSimMsgInit(MSG_ERROR_T Err)
292 {
293         // SAT Handler is initializing SIM now
294         if (bInitSim == true)
295         {
296                 // Init SMSC List and CB ID Info
297                 try
298                 {
299                         if (bSMSPChanged == true) initSMSCList();
300                 }
301                 catch (MsgException& e)
302                 {
303                         // Send Result to TAPI
304                         sendResult(SMS_SAT_CMD_REFRESH, TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND);
305
306                         MSG_FATAL("%s", e.what());
307                         return;
308                 }
309
310                 try
311                 {
312                         if (bCBMIChanged == true) initCBConfig();
313                 }
314                 catch (MsgException& e)
315                 {
316                         // Send Result to TAPI
317                         sendResult(SMS_SAT_CMD_REFRESH, TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND);
318
319                         MSG_FATAL("%s", e.what());
320                         return;
321                 }
322
323                 // Send Result to TAPI
324                 sendResult(SMS_SAT_CMD_REFRESH, TAPI_SAT_R_SUCCESS);
325         }
326 }
327
328
329 void SmsPluginSatHandler::initSim()
330 {
331         bInitSim = true;
332
333         // Init SIM Message
334         if (SmsPluginEventHandler::instance()->callbackInitSimBySat() != MSG_SUCCESS)
335         {
336                 MSG_DEBUG("Init Sim Error");
337
338                 // Send Result to TAPI
339                 sendResult(SMS_SAT_CMD_REFRESH, TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND);
340         }
341 }
342
343
344 void    SmsPluginSatHandler::initSMSCList()
345 {
346         MSG_SETTING_S settingData;
347
348         settingData.type = MSG_SMSC_LIST;
349
350         // Get Data From SIM
351         SmsPluginSetting::instance()->getConfigData(&settingData);
352
353         MSG_DEBUG("total_count[%d]", settingData.option.smscList.totalCnt);
354         MSG_DEBUG("selected[%d]", settingData.option.smscList.selected);
355
356         for (int i = 0; i < settingData.option.smscList.totalCnt; i++)
357         {
358                 MSG_DEBUG("pid[%d]", settingData.option.smscList.smscData[i].pid);
359                 MSG_DEBUG("val_period[%d]", settingData.option.smscList.smscData[i].valPeriod);
360                 MSG_DEBUG("name[%s]", settingData.option.smscList.smscData[i].name);
361
362                 MSG_DEBUG("ton[%d]", settingData.option.smscList.smscData[i].smscAddr.ton);
363                 MSG_DEBUG("npi[%d]", settingData.option.smscList.smscData[i].smscAddr.npi);
364                 MSG_DEBUG("address[%s]", settingData.option.smscList.smscData[i].smscAddr.address);
365         }
366
367         if (MsgSettingSetInt(SMSC_SELECTED, settingData.option.smscList.selected) != MSG_SUCCESS)
368         {
369                 THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", SMSC_SELECTED);
370                 return;
371         }
372
373         if (MsgSettingSetInt(SMSC_TOTAL_COUNT, settingData.option.smscList.totalCnt) != MSG_SUCCESS)
374         {
375                 THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", SMSC_TOTAL_COUNT);
376                 return;
377         }
378
379         char keyName[128];
380         MSG_ERROR_T err = MSG_SUCCESS;
381
382         for (int i = 0; i < settingData.option.smscList.totalCnt; i++)
383         {
384                 memset(keyName, 0x00, sizeof(keyName));
385                 sprintf(keyName, "%s/%d", SMSC_PID, i);
386
387                 if ((err = MsgSettingSetInt(keyName, (int)settingData.option.smscList.smscData[i].pid)) != MSG_SUCCESS)
388                         break;
389
390                 memset(keyName, 0x00, sizeof(keyName));
391                 sprintf(keyName, "%s/%d", SMSC_VAL_PERIOD, i);
392
393                 if ((err = MsgSettingSetInt(keyName, (int)settingData.option.smscList.smscData[i].valPeriod)) != MSG_SUCCESS)
394                         break;
395
396                 memset(keyName, 0x00, sizeof(keyName));
397                 sprintf(keyName, "%s/%d", SMSC_NAME, i);
398
399                 if ((err = MsgSettingSetString(keyName, settingData.option.smscList.smscData[i].name)) != MSG_SUCCESS)
400                         break;
401
402                 memset(keyName, 0x00, sizeof(keyName));
403                 sprintf(keyName, "%s/%d", SMSC_TON, i);
404
405                 if ((err = MsgSettingSetInt(keyName, (int)settingData.option.smscList.smscData[i].smscAddr.ton)) != MSG_SUCCESS)
406                         break;
407
408                 memset(keyName, 0x00, sizeof(keyName));
409                 sprintf(keyName, "%s/%d", SMSC_NPI, i);
410
411                 if ((err = MsgSettingSetInt(keyName, (int)settingData.option.smscList.smscData[i].smscAddr.npi)) != MSG_SUCCESS)
412                         break;
413
414                 memset(keyName, 0x00, sizeof(keyName));
415                 sprintf(keyName, "%s/%d", SMSC_ADDRESS, i);
416
417                 if ((err = MsgSettingSetString(keyName, settingData.option.smscList.smscData[i].smscAddr.address)) != MSG_SUCCESS)
418                         break;
419         }
420
421         if (err != MSG_SUCCESS)
422         {
423                 THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", keyName);
424         }
425 }
426
427
428 void    SmsPluginSatHandler::initCBConfig()
429 {
430         MSG_SETTING_S settingData;
431
432         settingData.type = MSG_CBMSG_OPT;
433
434         // Get Data From SIM
435         SmsPluginSetting::instance()->getConfigData(&settingData);
436
437         if (MsgSettingSetBool(CB_RECEIVE, settingData.option.cbMsgOpt.bReceive) != MSG_SUCCESS)
438         {
439                 THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_RECEIVE);
440                 return;
441         }
442
443         if (MsgSettingSetBool(CB_ALL_CHANNEL, settingData.option.cbMsgOpt.bAllChannel) != MSG_SUCCESS)
444         {
445                 THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_ALL_CHANNEL);
446                 return;
447         }
448
449         if (MsgSettingSetInt(CB_MAX_SIM_COUNT, settingData.option.cbMsgOpt.maxSimCnt) != MSG_SUCCESS)
450         {
451                 THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_MAX_SIM_COUNT);
452                 return;
453         }
454
455         if (MsgSettingSetInt(CB_CHANNEL_COUNT, settingData.option.cbMsgOpt.channelData.channelCnt) != MSG_SUCCESS)
456         {
457                 THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_CHANNEL_COUNT);
458                 return;
459         }
460
461         char keyName[128];
462         MSG_ERROR_T err = MSG_SUCCESS;
463
464         for (int i = 0; i < settingData.option.cbMsgOpt.channelData.channelCnt; i++)
465         {
466                 memset(keyName, 0x00, sizeof(keyName));
467                 sprintf(keyName, "%s/%d", CB_CHANNEL_ACTIVATE, i);
468
469                 if ((err = MsgSettingSetBool(keyName, settingData.option.cbMsgOpt.channelData.channelInfo[i].bActivate)) != MSG_SUCCESS)
470                         break;
471
472                 memset(keyName, 0x00, sizeof(keyName));
473                 sprintf(keyName, "%s/%d", CB_CHANNEL_ID, i);
474
475                 if ((err = MsgSettingSetInt(keyName, settingData.option.cbMsgOpt.channelData.channelInfo[i].id)) != MSG_SUCCESS)
476                         break;
477
478                 memset(keyName, 0x00, sizeof(keyName));
479                 sprintf(keyName, "%s/%d", CB_CHANNEL_NAME, i);
480
481                 if ((err = MsgSettingSetString(keyName, settingData.option.cbMsgOpt.channelData.channelInfo[i].name)) != MSG_SUCCESS)
482                         break;
483         }
484
485         if (err != MSG_SUCCESS)
486         {
487                 THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", keyName);
488         }
489 }
490
491
492 int SmsPluginSatHandler::handleSatTpdu(unsigned char *pTpdu, unsigned char TpduLen, int bIsPackingRequired)
493 {
494         if (pTpdu == NULL)
495                 THROW(MsgException::SMS_PLG_ERROR, "SAT TPDU is NULL");
496
497         int pos = 0;
498
499         // TP-MTI, TP-RD, TP-VPF,  TP-RP, TP-UDHI, TP-SRR
500         // TP-VPF
501         SMS_VPF_T vpf = (SMS_VPF_T)(pTpdu[pos++] & 0x18);
502
503         // TP-MR
504         unsigned char tmpRef = pTpdu[pos];
505
506         MSG_DEBUG("current Msg Ref : %d", tmpRef);
507
508         pTpdu[pos] = tmpRef + 1;
509
510         MSG_DEBUG("new Msg Ref : %d", pTpdu[pos]);
511
512         pos++;
513
514         // TP-DA
515         SMS_ADDRESS_S destAddr = {0};
516         int addrLen = SmsPluginParamCodec::decodeAddress(&pTpdu[pos], &destAddr);
517
518         pos += addrLen;
519
520         // TP-PID
521         pos++;
522
523         // TP-DCS
524         SMS_DCS_S dcs = {0};
525
526         int dcsLen = SmsPluginParamCodec::decodeDCS(&pTpdu[pos], &dcs);
527
528         if (bIsPackingRequired == true)
529         {
530                 dcs.codingScheme = SMS_CHARSET_7BIT;
531
532                 char* pDcs = NULL;
533                 AutoPtr<char> dcsBuf(&pDcs);
534
535                 SmsPluginParamCodec::encodeDCS(&dcs, &pDcs);
536
537                 memcpy(&(pTpdu[pos]), pDcs, dcsLen);
538         }
539
540         pos++;
541
542         // TP-VP
543         if (vpf == SMS_VPF_RELATIVE)
544         {
545                 pos += MAX_REL_TIME_PARAM_LEN;
546         }
547         else if (vpf == SMS_VPF_ABSOLUTE)
548         {
549                 pos += MAX_ABS_TIME_PARAM_LEN;
550         }
551
552         // TP-UDL
553         int udl = pTpdu[pos];
554
555         int retLen = 0;
556
557         if (bIsPackingRequired == true)
558         {
559                 SMS_USERDATA_S userData = {0};
560
561                 userData.headerCnt = 0;
562                 userData.length = udl;
563                 memcpy(userData.data, &pTpdu[pos+1], udl);
564                 userData.data[udl] = '\0';
565
566 MSG_DEBUG("user data : %s", userData.data);
567
568                 int encodeSize = SmsPluginUDCodec::encodeUserData(&userData, dcs.codingScheme, (char*)&pTpdu[pos]);
569
570                 retLen = pos + encodeSize;
571         }
572         else
573         {
574                 retLen = TpduLen;
575         }
576
577         return retLen;
578 }
579
580
581 void SmsPluginSatHandler::sendResult(SMS_SAT_CMD_TYPE_T CmdType, int ResultType)
582 {
583         TelSatAppsRetInfo_t satRetInfo;
584
585         satRetInfo.commandId = commandId;
586
587         MSG_DEBUG("satRetInfo.commandId [%d]", satRetInfo.commandId);
588
589         if (CmdType == SMS_SAT_CMD_REFRESH)
590         {
591                 satRetInfo.commandType = TAPI_SAT_CMD_TYPE_REFRESH;
592
593                 satRetInfo.appsRet.refresh.appType = TAPI_SAT_REFRESH_MSG;
594                 satRetInfo.appsRet.refresh.resp = (TelSatResultType_t)ResultType;
595         }
596         else if (CmdType == SMS_SAT_CMD_SEND_SMS)
597         {
598                 satRetInfo.commandType = TAPI_SAT_CMD_TYPE_SEND_SMS;
599
600                 satRetInfo.appsRet.sendSms.resp = (TelSatResultType_t)ResultType;
601         }
602
603         int tapiRet = TAPI_API_SUCCESS;
604
605         tapiRet = tel_send_sat_app_exec_result(&satRetInfo);
606
607         if (tapiRet == TAPI_API_SUCCESS)
608         {
609                 MSG_DEBUG("TelTapiSatSendAppExecutionResult() SUCCESS");
610         }
611         else
612         {
613                 MSG_DEBUG("TelTapiSatSendAppExecutionResult() FAIL [%d]", tapiRet);
614         }
615
616         bSendSms = false;
617         bInitSim = false;
618         bSMSPChanged = false;
619         bCBMIChanged = false;
620 }
621